| 1 |
/* PR c/65050 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
|
| 4 |
typedef int A[]; |
| 5 |
struct S { int i; A a[5]; } s; /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */ |
| 6 |
extern void foo (int p[2][]); /* { dg-error "array type has incomplete element type .int\\\[\\\]." } */ |
| 7 |
extern void bar (A p[2]); /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */ |
| 8 |
|
| 9 |
void |
| 10 |
foo (int p[2][]) /* { dg-error "array type has incomplete element type .int\\\[\\\]." } */ |
| 11 |
{ |
| 12 |
} |
| 13 |
|
| 14 |
void |
| 15 |
bar (A p[2]) /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */ |
| 16 |
{ |
| 17 |
} |
| 18 |
|
| 19 |
struct T; |
| 20 |
struct T t[5]; /* { dg-error "array type has incomplete element type .struct T." } */ |
| 21 |
struct U u[] = { { "abc" } }; /* { dg-error "array type has incomplete element type .struct U." } */ |
| 22 |
typedef struct T TT; |
| 23 |
TT tt[5]; /* { dg-error "array type has incomplete element type 'TT' {aka 'struct T'}" } */ |