Debian Codegraph @

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

raw
1 // Test that a base with only a move constructor causes the implicit copy
2 // constructor to be deleted.
3 // { dg-do compile { target c++11 } }
4
5 struct A // { dg-message "declares a move" }
6 {
7 A();
8 A(A&&);
9 };
10
11 struct B: A // { dg-error "use of deleted" }
12 {
13 };
14
15 int main()
16 {
17 B b1;
18 B b2(b1); // { dg-error "deleted function .B::B.const" }
19 B b3(static_cast<B&&>(b1));
20 }