If test.cc is: class F { friend void global_f() {} }; class G { void member_of_g() { global_f(); } };
then gcc -c test.cc yields test.cc: In member function 'void G::member_of_g()': test.cc:5: error: 'global_f' was not declared in this scope which appears to be wrong. % gcc -v Using built-in specs. Target: ia64-unknown-linux-gnu Configured with: ../configure --prefix=/wga1/gcc --enable-checking=release Thread model: posix gcc version 4.1.0 20050926 (experimental) -- Summary: gcc 4.1.0 20050926 - friends not visible outside class Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jaffe at broad dot mit dot edu CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: ia64-unknown-linux-gnu GCC host triplet: ia64-unknown-linux-gnu GCC target triplet: ia64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24090