The following invalid code snippet causes an ICE since GCC 4.1.0:
=================================
template<int> struct A {};
template<typename T> struct B
{
template<T I> B(A<I>);
};
B<double> a=A<0>();
=================================
bug.cc: In instantiation of 'B<double>':
bug.cc:8: instantiated from here
bug.cc:5: error: 'double' is not a valid type for a template constant parameter
bug.cc:8: internal compiler error: in template_decl_level, at cp/pt.c:9986
Please submit a full bug report, [etc.]
Testing a patch.
--
Summary: [4.1/4.2 regression] ICE with invalid template constant
parameter
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: reichelt at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28110