2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / attrib32.C
blob31a92b8f45c57594466acf67767bcec780e2c304
1 // PR c++/35315
3 typedef union { int i; } U __attribute__((transparent_union));
5 static void foo(U) {}
6 static void foo(int) {}
8 void bar()
10   foo(0);
13 typedef union U1 { int i; } U2 __attribute__((transparent_union)); // { dg-warning "ignored" }
15 static void foo2(U1) {}         // { dg-message "previously defined" }
16 static void foo2(U2) {}         // { dg-error "redefinition" }
18 void bar2(U1 u1, U2 u2)
20   foo2(u1);
21   foo2(u2);
24 // PR c++/36410
25 struct A
27   typedef union
28   {
29     int i;
30   } B __attribute__((transparent_union));
33 void foo(A::B b)
35   b.i;