PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-anon-struct-2.c
blobd954b4b12703b6f0985627c192ee05bea1d746b5
1 /* Test for anonymous structures and unions in C11. Test for invalid
2 cases. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c11 -pedantic-errors" } */
6 typedef struct s0
8 int i;
9 } s0;
11 struct s1
13 int a;
14 struct s0; /* { dg-error "declaration does not declare anything" } */
17 struct s2
19 int a;
20 s0; /* { dg-error "declaration does not declare anything" } */
23 struct s3
25 struct
27 int i;
29 struct
31 int i; /* { dg-error "duplicate member" } */
35 struct s4
37 int a;
38 struct s
40 int i;
41 }; /* { dg-error "declaration does not declare anything" } */
44 struct s5
46 struct
48 int i;
49 } a;
50 int b;
51 } x;
53 void
54 f (void)
56 x.i = 0; /* { dg-error "has no member" } */