Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/union2.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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); |