annotate gcc/testsuite/gcc.dg/c99-flex-array-typedef-8.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef char T[];
kono
parents:
diff changeset
5 struct foo { int x; T y; };
kono
parents:
diff changeset
6 struct bar { struct foo f; };
kono
parents:
diff changeset
7 struct baz { struct bar b; };
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct foo a1 = { 1, "abc" };
kono
parents:
diff changeset
10 struct foo a2 = { 1, { "abc" } };
kono
parents:
diff changeset
11 struct foo b1[] = { { 1, "abc" } }; /* { dg-error "initialization of flexible array member" } */
kono
parents:
diff changeset
12 struct foo b2[] = { { 1, { "abc" } } }; /* { dg-error "initialization of flexible array member" } */
kono
parents:
diff changeset
13 struct bar c1[] = { { { 1, "abc" } } }; /* { dg-error "initialization of flexible array member" } */
kono
parents:
diff changeset
14 struct bar c2[] = { { { 1, { "abc" } } } }; /* { dg-error "initialization of flexible array member" } */
kono
parents:
diff changeset
15 struct baz d1[] = { { { { 1, "abc" } } } }; /* { dg-error "initialization of flexible array member" } */
kono
parents:
diff changeset
16 struct baz d2[] = { { { { 1, { "abc" } } } } }; /* { dg-error "initialization of flexible array member" } */