gcc/testsuite/g++.dg/cpp0x/deleted8.C
raw| 1 | // PR c++/56633 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct A { |
| 5 | A(int) { } |
| 6 | A(const A&) = delete; |
| 7 | }; |
| 8 | |
| 9 | struct Test1 { |
| 10 | A value2{0}; // no problem here |
| 11 | }; |
| 12 | |
| 13 | template <typename T> // T is not used |
| 14 | struct Test2 { |
| 15 | A value2{0}; // fails to compile |
| 16 | }; |
| 17 | |
| 18 | int main() { |
| 19 | Test1 test; |
| 20 | Test2<int> test2; |
| 21 | return 0; |
| 22 | } |