The following invalid code snippet triggers an ICE since GCC 4.0.0: ========================================================== struct A { int i; };
template<typename T> int A::foo(int T::*) { return 0; } int j = A::foo(&A::i); ========================================================== bug.cc:6: error: no 'int A::foo(int T::*)' member function declared in class 'A' bug.cc:6: error: template definition of non-template 'int A::foo(int T::*)' bug.cc:8: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:213 Please submit a full bug report, [etc.] -- Summary: [4.1/4.2/4.3 regression] ICE with forgotten member declaration Product: gcc Version: 4.3.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=31751