aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C
new file mode 100644
index 0000000..eeb4aa9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C
@@ -0,0 +1,20 @@
+// Test that a base with only a move constructor causes the implicit copy
+// constructor to be deleted.
+// { dg-do compile { target c++11 } }
+
+struct A // { dg-message "declares a move" }
+{
+ A();
+ A(A&&);
+};
+
+struct B: A // { dg-error "use of deleted" }
+{
+};
+
+int main()
+{
+ B b1;
+ B b2(b1); // { dg-error "deleted function .B::B.const" }
+ B b3(static_cast<B&&>(b1));
+}