The source snippet at the bottom used to compile with gcc up to including 4.0.0,
and stopped compiling with 4.0.1. The most recent version I tried was gcc version 4.1.0 20051202 and it failes. This also compiles fine with a number of other compilers, including Intel-C++, Comeau-C++, Visual-C++, Sun-CC. The source: ------------------------------------------------------------- class A { friend class B; B *b; }; main() { A a; } ------------------------------------------------------------- gcc-4.1 -S -O friend-opaque.cc friend-opaque.cc:1: error: ISO C++ forbids declaration of 'B' with no type friend-opaque.cc:1: error: expected ';' before '*' token ------------------------------------------------------------- -- Summary: friend decl doesn't declare opaquely Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: duz at sol-3 dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25388