http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58053
Bug ID: 58053 Summary: Bogus "error ... is private ... within this context" 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 Test case: class Foo { struct Bar { }; friend class F; }; class F #ifdef BUG : public Foo::Bar #endif { void Fn() { Foo::Bar b; } }; Using "g++ (GCC) 4.9.0 20130730 (experimental)", the test compiles (clearly Foo::Bar is accessible to F::Fn()), but fails with -DBUG: t.cc:2:10: error: ‘struct Foo::Bar’ is private struct Bar { }; ^ t.cc:8:17: error: within this context : public Foo::Bar ^