1 /* { dg-options "-std=c99 -pedantic-errors" } */
3 int a
[*]; /* { dg-error "not allowed in other than function prototype scope" } */
4 void foo1() { int a
[*]; } /* { dg-error "not allowed in other than function prototype scope" } */
5 void foo2() { int a
[*]; } /* { dg-error "not allowed in other than function prototype scope" } */
6 int foo3(int i
)[*]; /* { dg-error "not allowed in other than function prototype scope" } */
7 void foo4(int o
[*][4]) { } /* { dg-error "not allowed in other than function prototype scope" } */
8 void foo5(int o
[4][*]) { } /* { dg-error "not allowed in other than function prototype scope" } */
10 /* [*] can't be used in a type that's not a declaration (maybe, the
11 final wording for DR#341 would allow it although the first
12 discussed intent would not). */
13 void foo11(int x
[sizeof(int (*)[*])]); /* { dg-warning "not in a declaration" } */
14 /* This case is allowed per DR#341. */
20 typedef int (*vla
)[m
];
22 vla x
; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
24 int (*y
)[n
]; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
25 int z
[n
]; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
28 extern int (*r
)[m
]; /* { dg-error "variably modified type must have no linkage" } */