http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57376
Bug ID: 57376 Summary: Bogus error due to failure of unqualified namespace lookup Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Reproduced with current trunk @r199204. g++ -c t.cc t.cc:17:25: error: ‘F2’ is neither function nor member function; cannot be declared friend friend Foo *Foo::F2(Woo *); // error ^ t.cc:17:22: error: expected ‘;’ at end of member declaration friend Foo *Foo::F2(Woo *); // error ^ t.cc:17:29: error: expected ‘)’ before ‘*’ token friend Foo *Foo::F2(Woo *); // error ^ Source appears to be completely kosher and is accepted by Clang and EDG. Test case: /// --- cut --- namespace B { class Woo; } struct Foo { Foo* F1(B::Woo *); Foo* F2(B::Woo *); }; namespace B { class Boo:Foo { friend Foo *Foo::F1(B::Woo *); // ok friend Foo *Foo::F2(Woo *); // error }; } /// --- cut ---