summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/union2.C
blob: 4f193e281c8aefa1a17a71d4b71184180a24cf08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Positive test for C++0x unrestricted unions
// { dg-options -std=c++0x }

struct A
{
  A();
  A(const A&);
  ~A();
};

union B
{
  A a;
  B();
  B(const B&);
  ~B();
};

B b;
B b2(b);

struct C
{
  union
  {
    A a;
  };
  C();
  C(const C&);
  ~C();
};

C c;
C c2(c);
OpenPOWER on IntegriCloud