Implement C++0x unrestricted unions (N2544)
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / union1.C
blob291853d5aaeb6c86385480711f3ed397ad9707aa
1 // Negative test for C++0x unrestricted unions
2 // { dg-options -std=c++0x }
3 // { dg-prune-output "implicitly deleted because" }
5 struct A
7   A();
8   A(const A&);
9   ~A();
12 union B
14   A a;                          // { dg-error "union member" }
17 B b;                            // { dg-error "B::B\\(\\)" }
18 B b2(b);                        // { dg-error "B::B\\(const B&\\)" }
20 struct C
22   union
23   {
24     A a;                        // { dg-error "union member" }
25   };
28 C c;                            // { dg-error "C::C\\(\\)" }
29 C c2(c);                        // { dg-error "C::C\\(const C&\\)" }
31 // { dg-error "B::~B" "" { target *-*-* } 17 }
32 // { dg-error "B::~B" "" { target *-*-* } 18 }
33 // { dg-error "C::~C" "" { target *-*-* } 28 }
34 // { dg-error "C::~C" "" { target *-*-* } 29 }