http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52136
Bug #: 52136 Summary: g++ is wrongly propagating "friend class" to the parent class Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: sylves...@debian.org --- class address { protected: static int parseNext(int a); }; class mailbox : public address { friend class mailboxField; }; class mailboxField { void parse(int a) { address::parseNext(a); // will work with: // mailbox::parseNext(a); } }; --- It should trigger: address.cpp: In member function ‘void mailboxField::parse(int)’: address.cpp:4:16: error: ‘static int address::parseNext(int)’ is protected address.cpp:17:33: error: within this context Tested with g++ 4.6.2