This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31323] New: typename A::B * p; in template definition, with curiously recurring template inheritance
- From: "mesti_mudam at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2007 05:37:10 -0000
- Subject: [Bug c++/31323] New: typename A::B * p; in template definition, with curiously recurring template inheritance
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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