The following code: class a { friend class b; b *pb; };
Produces an error message in the current mainline (4.1.0 development): bar.c:3: error: ISO C++ forbids declaration of 'b' with no type bar.c:3: error: expected ';' before '*' token 14882:2003, 11.4.7, indicates that this should be allowed: "A name nominated by a friend declaration shall be accessible in the scope of the class containing the friend declaration." This is a regression from 4.0. -- Summary: class friend declaration doesn't allow use in class scope Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: minor Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jconner at apple dot com CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21971