------- Comment #3 from mdjones0978-gccbugs at yahoo dot com 2009-10-30 02:48 ------- I think it is a bug, because the class test is declared at the scope :: (before the namespace), then used below. The solution is to explicitly state the fact it is from ::
#include <assert.h> class Test; namespace Boo { class Outer { friend class Test; // replace with ::Test to fix private: int _o; class Inner { friend class Test; // replace with ::Test to fix int _i; }; }; } class Test { public: void DoTest() { Boo::Outer::Inner oi; assert(oi._i == 3); } }; main(int argc, char *argv[]) { Test x; x.DoTest(); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36163