The following piece of code is compiled successfully ( g++ -ansi -pedantic -Wall -c p6.C): <CODE> class Test { friend void f() {}; }; void g(const Test &t) { f(); } </CODE> I think it shouldn't compile because there is no explicitly declared f() in the enclosing scope.
-- Summary: Friend function should not ne found. Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: eremefka at op dot pl GCC host triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26978