1 // PR c++/35315 2 3 typedef union { int i; } U __attribute__((transparent_union)); 4 foo(U)5static void foo(U) {} foo(int)6static void foo(int) {} 7 bar()8void bar() 9 { 10 foo(0); 11 } 12 13 typedef union U1 { int i; } U2 __attribute__((transparent_union)); // { dg-warning "ignored" } 14 foo2(U1)15static void foo2(U1) {} // { dg-error "previously defined" } foo2(U2)16static void foo2(U2) {} // { dg-error "redefinition" } 17 bar2(U1 u1,U2 u2)18void bar2(U1 u1, U2 u2) 19 { 20 foo2(u1); 21 foo2(u2); 22 } 23 24 // PR c++/36410 25 struct A 26 { 27 typedef union 28 { 29 int i; 30 } B __attribute__((transparent_union)); 31 }; 32 foo(A::B b)33void foo(A::B b) 34 { 35 b.i; 36 } 37