OSDN Git Service

Implement C++11 delegating constructors.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / implicit4.C
1 // Test that a base with only a move constructor causes the implicit copy
2 // constructor to be deleted.
3 // { dg-options "-std=c++0x" }
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 }