Hiding names with 'using' directive
问题 Code example: struct A {}; struct B { using A = A; }; int main() { B b; } Clang compiles it. But GCC gives the following error (demo): declaration of 'using A = struct A' changes meaning of 'A' The C++ standard says: If a class name ([class.name]) or enumeration name ([dcl.enum]) and a variable, data member, function, or enumerator are declared in the same declarative region (in any order) with the same name ( excluding declarations made visible via using-directives ([basic.lookup.unqual])),