https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91418
--- Comment #3 from Harald van Dijk <harald at gigawatt dot nl> --- I believe GCC is correct here. [class.friend]p11 (http://eel.is/c++draft/class.friend#11) specifies that `friend class A;`, with an unqualified name, does not find the global scope class A, but makes a (never defined) local class A a friend of B. An example that actually defines it shows how this could be used: class A { public: void func() { class B { B() = default; friend class A; }; class A { public: A() { B(); } }; A(); } };