summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/implicit5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/implicit5.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit5.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit5.C b/gcc/testsuite/g++.dg/cpp0x/implicit5.C
new file mode 100644
index 000000000..f25c08530
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit5.C
@@ -0,0 +1,19 @@
+// Test that the default B copy constructor calls the A member template
+// constructor.
+// { dg-options -std=c++0x }
+
+struct A
+{
+ A() = default;
+ A(A&&) = default;
+ template <class T>
+ A(const T& t) { t.i; } // { dg-error "no member" }
+};
+
+struct B: A { };
+
+int main()
+{
+ B b;
+ B b2(b);
+}