The following invalid code snippet triggers an ICE on mainline and the 4.1 branch (introduced after GCC 4.1.1):
========================================= template<int> void foo() { typedef int i = 0; } ========================================= bug.cc: In function 'void foo()': bug.cc:3: error: typedef 'i' is initialized (use __typeof__ instead) bug.cc:3: internal compiler error: tree check: expected var_decl, have type_decl in cp_finish_decl, at cp/decl.c:5080 Please submit a full bug report, [etc.] -- Summary: [4.1/4.2 regression] ICE on typedef with initialization 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=28347