aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
new file mode 100644
index 000000000..22d6e97be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
@@ -0,0 +1,16 @@
+/* Test for C99 array declarators: expression must be an
+ assignment-expression. PR 11943. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ int a[2, 3]; /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void b(int x[2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void c(int [2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void d(int *x[restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void e(int *x[static restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void f(int *x[restrict static 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+}