Since GCC 3.4.0 we get an ICE on the following invalid code snippet:

=======================================
template<int> void foo();

template<int> struct A
{
    template<> friend void foo<0>();
};
=======================================

bug.cc:5: error: invalid explicit specialization before '>' token
bug.cc:5: error: explicit specialization in non-namespace scope 'struct
A<<anonymous> >'
bug.cc:5: error: enclosing class templates are not explicitly specialized
bug.cc:6: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

-- 
           Summary: [3.4/4.0/4.1 regression] ICE on invalid template
                    specialization
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to