This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31323] New: typename A::B * p; in template definition, with curiously recurring template inheritance


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]