PR middle-end/27945
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-array-nonobj-1.c
blob45fc74c4c44ce0677e1eaed7ea2cf668f0f1880f
1 /* Test for arrays of incomplete and function types: a constraint violation
2 in C99 only, though undefined (DR#047) before.
3 */
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
8 typedef void func (void);
9 struct s;
11 extern int a[][]; /* { dg-bogus "warning" "warning in place of error" } */
12 /* { dg-error "array" "\[\]\[\] var" { target *-*-* } 11 } */
14 void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */
15 /* { dg-error "array" "\[\]\[\] arg" { target *-*-* } 14 } */
17 extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */
18 /* { dg-error "array" "struct \[\] var" { target *-*-* } 17 } */
20 void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */
21 /* { dg-error "array" "struct \[\] arg" { target *-*-* } 20 } */
23 extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */
24 /* { dg-error "array" "func \[\] var" { target *-*-* } 23 } */
26 void h (func []); /* { dg-bogus "warning" "warning in place of error" } */
27 /* { dg-error "array" "func \[\] arg" { target *-*-* } 26 } */