1 // PR c++/35315
2 
3 typedef union { int i; } U __attribute__((transparent_union));
4 
foo(U)5 static void foo(U) {}
foo(int)6 static void foo(int) {}
7 
bar()8 void bar()
9 {
10   foo(0);
11 }
12 
13 typedef union U1 { int i; } U2 __attribute__((transparent_union)); // { dg-warning "ignored" }
14 
foo2(U1)15 static void foo2(U1) {}		// { dg-error "previously defined" }
foo2(U2)16 static void foo2(U2) {}		// { dg-error "redefinition" }
17 
bar2(U1 u1,U2 u2)18 void 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)33 void foo(A::B b)
34 {
35   b.i;
36 }
37