aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr65050.c
blob: e29559d3e73fe880a104b2af65b254b08ac2ac0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR c/65050 */
/* { dg-do compile } */

typedef int A[];
struct S { int i; A a[5]; } s; /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */
extern void foo (int p[2][]); /* { dg-error "array type has incomplete element type .int\\\[\\\]." } */
extern void bar (A p[2]); /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */

void
foo (int p[2][]) /* { dg-error "array type has incomplete element type .int\\\[\\\]." } */
{
}

void
bar (A p[2]) /* { dg-error "array type has incomplete element type 'A' {aka 'int\\\[\\\]'}" } */
{
}

struct T;
struct T t[5]; /* { dg-error "array type has incomplete element type .struct T." } */
struct U u[] = { { "abc" } }; /* { dg-error "array type has incomplete element type .struct U." } */
typedef struct T TT;
TT tt[5]; /* { dg-error "array type has incomplete element type 'TT' {aka 'struct T'}" } */