PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-array-nonobj-1.c
blobd4566b701058cd9d92a8aa219165526f187a4919
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 *-*-* } .-1 } */
14 void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */
15 /* { dg-error "array" "\[\]\[\] arg" { target *-*-* } .-1 } */
17 extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */
18 /* { dg-error "array" "struct \[\] var" { target *-*-* } .-1 } */
20 void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */
21 /* { dg-error "array" "struct \[\] arg" { target *-*-* } .-1 } */
23 extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */
24 /* { dg-error "array" "func \[\] var" { target *-*-* } .-1 } */
26 void h (func []); /* { dg-bogus "warning" "warning in place of error" } */
27 /* { dg-error "array" "func \[\] arg" { target *-*-* } .-1 } */