aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C
new file mode 100644
index 000000000..d55d3d2a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C
@@ -0,0 +1,20 @@
+// { dg-options "-std=c++11" }
+
+struct A
+{
+ int i;
+ explicit A(int i): i(i) {}
+};
+
+struct B: A
+{
+ using A::A;
+};
+
+void f(B);
+
+int main()
+{
+ f(B(42)); // OK
+ f(42); // { dg-error "could not convert" }
+}