[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-anon-struct-3.c
blob05cc3660cb8b2fd1feddd437296b81df040d35f6
1 /* Test for anonymous structures and unions in C11. Test for invalid
2 cases: typedefs disallowed by N1549. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c11 -pedantic-errors" } */
6 typedef struct
8 int i;
9 } s0;
11 typedef union
13 int i;
14 } u0;
16 struct s1
18 int a;
19 u0; /* { dg-error "declaration does not declare anything" } */
20 struct
22 int b;
26 union u1
28 int b;
29 s0; /* { dg-error "declaration does not declare anything" } */
30 union
32 int c;