aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
blob: 22d6e97be46fd6bab2b50c41b9944017d3d7ebf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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" } */
}