The following invalid testcase causes an ICE since GCC 4.0.0: =========================================== template<int> void foo(struct {}*);
void bar() { foo<0>(0); } =========================================== bug.cc:1: error: template class without a name bug.cc:1: error: types may not be defined in parameter types bug.cc:5: error: conflicting declaration 'struct<anonymous>' bug.cc:5: error: 'struct<anonymous>' has a previous declaration as 'struct<anonymous>' bug.cc: In function 'void bar()': bug.cc:5: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in pushtag, at cp/name-lookup.c:4865 Please submit a full bug report, [etc.] Moreover only the second line of the error message makes sense. The "conflicting declaration" message is completely bogus, and the first line looks bogus to me, too. -- Summary: [4.0/4.1/4.2 regression] ICE with struct definition in argument of template function Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, error-recovery, diagnostic, 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=28114