PR c/122591

gcc/testsuite/ChangeLog:

        * gcc.dg/countof-compile.c (type): Test return type of _Countof.

Reported-by: Reported-by: Sam James <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
---
 gcc/testsuite/gcc.dg/countof-compile.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/countof-compile.c 
b/gcc/testsuite/gcc.dg/countof-compile.c
index afd5659618b4..ebbac16ed38d 100644
--- a/gcc/testsuite/gcc.dg/countof-compile.c
+++ b/gcc/testsuite/gcc.dg/countof-compile.c
@@ -122,3 +122,9 @@ const_expr(void)
   _Static_assert (_Countof (int [3][n]) == 3);
   _Static_assert (_Countof (int [n][3]) == 7); /* { dg-error "not constant" } 
*/
 }
+
+void
+type(void)
+{
+  _Generic (_Countof (w), __typeof__ (sizeof 0): 0);
+}
-- 
2.51.0

Reply via email to