summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/union5.C
blob: 423b3482323fdc84a52e38aad3ae4fe648d32b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/49803
// { dg-options -std=c++0x }

struct X
{
  X() = delete;
};

union Y
{
  // N3291=11-0061 12.6.2/8 says no initialization of
  // of other variant members (i.e. m_x) should
  // be performed.
  Y() : m_char1{ }
  { }

  struct
  {
    char m_char1;
  };

  X    m_x;
};