aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
new file mode 100644
index 0000000..e8dc84d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
@@ -0,0 +1,17 @@
+// { dg-do compile { target c++11 } }
+
+struct B1 {
+ B1(int);
+};
+struct B2 {
+ B2(int);
+};
+struct D1 : B1, B2 {
+ using B1::B1; // { dg-error "inherited" }
+ using B2::B2; // { dg-error "inherited" }
+}; // ill-formed: attempts to declare D1(int) twice
+struct D2 : B1, B2 {
+ using B1::B1;
+ using B2::B2;
+ D2(int); // OK: user declaration supersedes both implicit declarations
+};