Consider this code:
#include <iostream>
#include <type_traits>
struct A
{
A(int x) {std::cout << "A(" << x << ")\n";}
};
struct B : A
{
using A::A;
B(int x, int y) : A(x) {std::cout << "B(" << x << "," << y << ")\n";}
};
struct C : B
{
using B::A; // <--
// C() : B(0,0) {}
};
int main()
{
C c(1);
}
It compiles on GCC and prints A(1), which means that an instance of B was "constructed" without calling the constructor. If you uncomment C(), then C c(1); no longer compiles (GCC can't find a suitable constructor)
Clang doesn't say anything about using B::A;, but refuses to compile C c(1); (also can't find a suitable constructor).
MSVC stops right at using B::A;, basically saying that you can only inherit constructors from direct bases.
Cppreference doesn't mention inheriting constructors from indirect bases, so it seems to be disallowed.
Is it a GCC & Clang bug, or what's going on here?