gcc/testsuite/g++.dg/cpp0x/deleted17.C
raw| 1 | // PR c++/94231 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct F {F(F&&)=delete;}; |
| 5 | |
| 6 | template<int=0> |
| 7 | struct M { |
| 8 | F f; |
| 9 | M(); |
| 10 | M(const M&); |
| 11 | M(M&&); |
| 12 | }; |
| 13 | |
| 14 | template<int I> |
| 15 | M<I>::M(M&&)=default; // { dg-error "use of deleted function" } |
| 16 | |
| 17 | M<> f() { |
| 18 | M<> m; |
| 19 | return m; |
| 20 | } |