gcc/testsuite/g++.dg/cpp0x/initlist-value2.C
raw| 1 | // Test that we properly value-initialize a class with a user-provided |
| 2 | // constructor but defaulted default constructor. The FDIS got this |
| 3 | // wrong; see c++std-core-19883. |
| 4 | |
| 5 | // { dg-do run { target c++11 } } |
| 6 | |
| 7 | struct A |
| 8 | { |
| 9 | int i; |
| 10 | A() = default; |
| 11 | A(int); |
| 12 | }; |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | A a{}; |
| 17 | if (a.i != 0) |
| 18 | return 1; |
| 19 | } |