https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64267
Bug ID: 64267 Summary: [DR 482] Qualified declarators in redeclarations Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org namespace S { struct coll; struct ::S::coll { }; } qual.cc:4:20: error: global qualification of class name is invalid before ‘{’ token struct ::S::coll { }; ^ Clang 3.4 rejected this but 3.5 accepts it (with a -Wextra-qualification warning) and EDG accepts it. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#482 makes this valid, in at least C++14 (but it's a DR against C++11 so maybe there too). The example from DR 482 is: void f(); void ::f(); // error: qualified declarator namespace N { void f(); void N::f() { } // error: qualified declarator } I get the same results for this, Clang 3.4 rejects, 3.5+ accepts, EDG accepts, and G++ rejects in all modes: dr482.cc:2:14: error: explicit qualification in declaration of ‘void f()’ void ::f(); // error: qualified declarator ^ dr482.cc:6:17: error: explicit qualification in declaration of ‘void N::f()’ void N::f() { } // error: qualified declarator ^