struct A { private: class face; friend class face; }; struct A::face {}; template <typename _CharT> struct C : public A::face {}; int main() { C<int> x; } gets compiled on g++ 4.6.1. It shouldn't because "A name nominated by a friend declaration shall be accessible in the scope of the class containing the friend declaration" [11.4.7] A::face is inaccessible at the point of derivation. Comeau issues an error message.
I think this is related to PR 47346.
(In reply to Andrew Pinski from comment #1) > I think this is related to PR 47346. Yes, it has nothing to do with the friend declaration. *** This bug has been marked as a duplicate of bug 47346 ***