The following code doesnt compile with gcc, dmc, icc. Im not sure if its correct code, but it looks like it is.
#include <iostream> using std::cout; using std::endl; template <class T> class Base { protected: typename T::privIC * priv; public: virtual int f1() =0; virtual int f2() =0; }; class A : public Base<A> { public: class privIC { int i; }; int f1(); int f2(); }; int A::f1() { return 0; } int A::f2() { return 0; } int main() { A a; cout << a.f2() << endl; } -- Summary: typename A::B * p; in template definition, with curiously recurring template inheritance Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mesti_mudam at yahoo dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31323