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++/27665] New: [4.0/4.1/4.2 regression] ICE writing class instead of typename


The following code snippet triggers an ICE since GCC 3.4.0
(and in GCC 2.93.x):

==============================
template<int> struct A
{
    struct B
    {
        struct C {};
    };
};

template<int N> void foo()
{
    class A<N>::B::C X;
}

void bar()
{
    foo<0>();
}
==============================

bug.cc: In instantiation of 'A<0>::B':
bug.cc:11:   instantiated from 'void foo() [with int N = 0]'
bug.cc:26:   instantiated from here
bug.cc:4: internal compiler error: in instantiate_class_template, at
cp/pt.c:5591
Please submit a full bug report, [etc.]

I'm not quite sure whether writing "class" before "A<N>::B::C" is valid
or has to be replaced by "typename".


-- 
           Summary: [4.0/4.1/4.2 regression] ICE writing class instead of
                    typename
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27665


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