gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-options -fno-new-inheriting-ctors } |
| 3 | |
| 4 | struct B1 { |
| 5 | B1(int); |
| 6 | }; |
| 7 | struct B2 { |
| 8 | B2(int); |
| 9 | }; |
| 10 | struct D1 : B1, B2 { |
| 11 | using B1::B1; // { dg-message "declared" } |
| 12 | using B2::B2; // { dg-error "inherited" } |
| 13 | }; // ill-formed: attempts to declare D1(int) twice |
| 14 | struct D2 : B1, B2 { |
| 15 | using B1::B1; |
| 16 | using B2::B2; |
| 17 | D2(int); // OK: user declaration supersedes both implicit declarations |
| 18 | }; |