Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/implicit5.C

raw
1 // Test that the default B copy constructor calls the deleted A
2 // copy constructor.
3 // { dg-do compile { target c++11 } }
4
5 struct A // { dg-message "declares a move" }
6 {
7 A() = default;
8 A(A&&) = default;
9 template <class T>
10 A(const T& t) { t.i; }
11 };
12
13 struct B: A { }; // { dg-error "implicitly|use of deleted" }
14
15 int main()
16 {
17 B b;
18 B b2(b); // { dg-error "deleted" }
19 }