gcc/testsuite/g++.dg/cpp0x/defaulted54.C
raw| 1 | // Core Issue #1331 (const mismatch with defaulted copy constructor) |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct M |
| 5 | { |
| 6 | M(); |
| 7 | M(M&); |
| 8 | }; |
| 9 | |
| 10 | template<typename T> struct W |
| 11 | { |
| 12 | W(); |
| 13 | W(const W&) = default; // { dg-error "binding" } |
| 14 | // { dg-error "implicitly deleted" "" { target c++17_down } .-1 } |
| 15 | T t; |
| 16 | }; |
| 17 | |
| 18 | W<M> w; |
| 19 | W<M> w2 = w; // { dg-error "use of deleted function" } |