gcc/testsuite/g++.dg/cpp0x/union5.C
raw| 1 | // PR c++/49803 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "" } |
| 4 | |
| 5 | struct X |
| 6 | { |
| 7 | X() = delete; |
| 8 | }; |
| 9 | |
| 10 | union Y |
| 11 | { |
| 12 | // N3291=11-0061 12.6.2/8 says no initialization of |
| 13 | // of other variant members (i.e. m_x) should |
| 14 | // be performed. |
| 15 | Y() : m_char1{ } |
| 16 | { } |
| 17 | |
| 18 | struct |
| 19 | { |
| 20 | char m_char1; |
| 21 | }; |
| 22 | |
| 23 | X m_x; |
| 24 | }; |