The following invalid code snippet triggers an ICE since GCC 4.1.0: =============================== template<int> struct A { static const int i; };
template<int N> struct B { char c[A<N>::i], d; }; B<0> b; =============================== bug.cc: In instantiation of 'B<0>': bug.cc:11: instantiated from here bug.cc:7: internal compiler error: tree check: expected integer_cst, have nop_expr in walk_subobject_offsets, at cp/class.c:3126 Please submit a full bug report, [etc.] -- Summary: [4.1/4.2 regression] ICE with invalid const static variable Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-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=28595