The following invalid code snippet triggers an ICE since GCC 4.0.1: =========================== template<int> union A; struct A; ===========================
bug.cc:2: error: redeclaration of 'A<<anonymous> >' as a non-template bug.cc:2: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in xref_tag, at cp/decl.c:9670 Please submit a full bug report, [etc.] -- Summary: [4.0/4.1/4.2 regression] ICE redeclaring template as non-template 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=28710