| 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 <[email protected]> */ |
| 5 |
/* { dg-do compile } */ |
| 6 |
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ |
| 7 |
|
| 8 |
typedef void func (void); |
| 9 |
struct s; |
| 10 |
|
| 11 |
extern int a[][]; /* { dg-bogus "warning" "warning in place of error" } */ |
| 12 |
/* { dg-error "array" "\[\]\[\] var" { target *-*-* } .-1 } */ |
| 13 |
|
| 14 |
void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */ |
| 15 |
/* { dg-error "array" "\[\]\[\] arg" { target *-*-* } .-1 } */ |
| 16 |
|
| 17 |
extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */ |
| 18 |
/* { dg-error "array" "struct \[\] var" { target *-*-* } .-1 } */ |
| 19 |
|
| 20 |
void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */ |
| 21 |
/* { dg-error "array" "struct \[\] arg" { target *-*-* } .-1 } */ |
| 22 |
|
| 23 |
extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */ |
| 24 |
/* { dg-error "array" "func \[\] var" { target *-*-* } .-1 } */ |
| 25 |
|
| 26 |
void h (func []); /* { dg-bogus "warning" "warning in place of error" } */ |
| 27 |
/* { dg-error "array" "func \[\] arg" { target *-*-* } .-1 } */ |