The following invalid code causes an ICE on mainline: ===================== bool foo() { const int i = X; return i > 0; } =====================
bug.cc: In function 'bool foo()': bug.cc:3: error: 'X' was not declared in this scope bug.cc:4: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in ocp_convert, at cp/cvt.c:630 Please submit a full bug report, [etc.] -- Summary: [4.2 regression] ICE with invalid const variable 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=27804