https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99160
--- Comment #4 from jim x <xmh970252187 at gmail dot com> --- [namespace.udecl#1] says > Each using-declarator in a using-declaration names the set of declarations > found by lookup ([basic.lookup.qual]) for the using-declarator, except that > class and enumeration declarations that would be discarded are merely ignored > when checking for ambiguity ([basic.lookup]), conversion function templates > with a dependent return type are ignored, and certain functions are hidden as > described below. That means, in the eventual lookup set, the class and enumeration are also included(if any). [basic.lookup.qual#general-1] says > Lookup of an identifier followed by a :: scope resolution operator > considers only namespaces, types, and templates whose specializations are > types. This means the lookup for `C` in `B::C::type` only consideres types in this case. [namespace.udecl#16] says > A using-declaration has the usual accessibility for a member-declaration. > Base-class constructors considered because of a using-declarator are > accessible if they would be accessible when used to construct an object of > the base class; the accessibility of the using-declaration is ignored. Hence, the name introduced by the using-declaration will have the same accessibility as it.