Can a using-declaration name a public member of an indirect base class that becomes private in a direct base class?

10 hours ago 3
ARTICLE AD BOX

Consider

struct A { int member; }; struct B : public A { private: using A::member; }; struct C : public B { using A::member; // #1 };

Clang, EDG, and MSVC accept the snippet, while GCC rejects (demo). All compilers reject if line #1 is changed to using B::member; (demo).

Is the using-declaration #1 valid?

Read Entire Article