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