This was fixed by r241765 but we didn't have an explicit test that tests if we detect the error of inheriting constructors from an indirect base.
Tested on x86_64-linux, applying to trunk. 2019-06-07 Marek Polacek <pola...@redhat.com> PR c++/77747 * g++.dg/cpp0x/inh-ctor33.C: New test. diff --git gcc/testsuite/g++.dg/cpp0x/inh-ctor33.C gcc/testsuite/g++.dg/cpp0x/inh-ctor33.C new file mode 100644 index 00000000000..95b7812f054 --- /dev/null +++ gcc/testsuite/g++.dg/cpp0x/inh-ctor33.C @@ -0,0 +1,19 @@ +// PR c++/77747 +// { dg-do compile { target c++11 } } + +class X { +public: + X() { } + X(int a) { } +}; + +class Y : public X { }; + +class Z : public Y { + using X::X; // { dg-error "cannot inherit constructors from indirect base .X." } +}; + +int main() +{ + Z z{3}; // { dg-error "no matching" } +}