Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/union2.C

raw
1 // Positive test for C++11 unrestricted unions
2 // { dg-do compile { target c++11 } }
3
4 struct A
5 {
6 A();
7 A(const A&);
8 ~A();
9 };
10
11 union B
12 {
13 A a;
14 B();
15 B(const B&);
16 ~B();
17 };
18
19 B b;
20 B b2(b);
21
22 struct C
23 {
24 union
25 {
26 A a;
27 };
28 C();
29 C(const C&);
30 ~C();
31 };
32
33 C c;
34 C c2(c);