PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / transparent-union-3.c
blob7f0dda54fae1b76b785c0468226c230b145c6b2f
1 /* Test for ICEs on invalid transparent unions (empty or no named
2 members). Bug 21213. */
3 /* Origin: Joseph Myers <joseph@codesourcery.com> */
4 /* { dg-do compile } */
5 /* { dg-options "" } */
7 enum e { A };
9 union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
10 /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */
11 union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */
12 /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */
14 union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
15 /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */
16 union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */
17 /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */
19 union __attribute__((__transparent_union__)) u1 { };
20 /* { dg-warning "union cannot be made transparent" "" { target *-*-* } .-1 } */
21 union u2 { } __attribute__((__transparent_union__));
22 /* { dg-warning "union cannot be made transparent" "" { target *-*-* } .-1 } */