The following code snippet crashes the C++ frontend:
===============================
namespace N
{
template<int> struct A {};
}
struct B N::A<0> {};
===============================
bug.cc:6: error: invalid use of constructor as a template
bug.cc:6: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
This is a recent regression on the 4.0 branch, 4.1 branch and mainline.
GCC 4.0.2 was not affected. We got the error message:
bug.cc:6: error: invalid function declaration
With GCC 3.4.5 the error message was:
bug.cc:6: error: `A<0>' specified as declarator-id
bug.cc:6: error: invalid function declaration
--
Summary: [4.0/4.1/4.2 regression] ICE on forgotten ":" in
definition of derived class
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, 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=25858