https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- IMHO that's a reasonable interpretation, but so is GCC's :-) Transforming the program as per 10.3.1.1 [namespace.unnamed] we get: namespace N { } using namespace N; namespace N { struct S; } class C { friend struct S; static void f(); }; namespace N { struct S { void f() { C::f(); } }; } GCC and EDG still reject this, and Clang still accepts it. This seems related to https://wg21.link/cwg138