https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Clang compiles it OK, but EDG says: "a.cc", line 5: error: class "A" cannot be defined in the current scope class A { void f() {} }; This seems similar to the G++ error, which is due to the name A referring to ::A, which should be defined in the global scope. I'm not sure whether the definition of Y::A should be an error, or (as Clang thinks) should declare a new type, which cannot be referred to due to the ambiguity caused by the using-declaration.