The following invalid code snippet triggers an ICE sincd GCC 3.4.5
(with the exception of GCC 4.0.0 and 4.0.1):
=========================================
template<int, int> struct A
{
static int i;
};
template<int> int A<0,0>::i = 0;
int j = A<0,0>::i;
=========================================
bug.cc:6:27: error: got 1 template parameters for 'int A<0, 0>::i'
bug.cc:6:27: error: but 2 required
bug.cc:8:18: internal compiler error: in import_export_decl, at cp/decl2.c:2244
Please submit a full bug report, [etc.]
--
Summary: [4.3/4.4/4.5 Regression] ICE with invalid initialization
of template member
Product: gcc
Version: 4.5.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=40405