gcc/testsuite/g++.dg/init/elide8.C
raw| 1 | // CWG 2403 case 3: we can't elide this copy because the delegating constructor |
| 2 | // might be used to initialize a base. |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | |
| 5 | struct Noncopyable { |
| 6 | Noncopyable() = default; |
| 7 | Noncopyable(const Noncopyable &) = delete; |
| 8 | Noncopyable(int) : Noncopyable(make()) {} // { dg-error "deleted" } |
| 9 | |
| 10 | static Noncopyable make(); |
| 11 | }; |