aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/countof-pedantic-errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/countof-pedantic-errors.c')
-rw-r--r--gcc/testsuite/gcc.dg/countof-pedantic-errors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/countof-pedantic-errors.c b/gcc/testsuite/gcc.dg/countof-pedantic-errors.c
new file mode 100644
index 0000000..5d5bedb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/countof-pedantic-errors.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+
+#include <stdcountof.h>
+
+int a[1];
+int b[countof(a)];
+int c[_Countof(a)]; /* { dg-error "ISO C does not support" } */