The following invalid code snippet triggers an ICE: ====================================== struct A; namespace { struct A; }
struct B {}; template<typename T> void foo(T t) { t.~A(); } void bar() { foo(B()); } ====================================== bug.cc: In function 'void foo(T)': bug.cc:8:6: error: reference to 'A' is ambiguous bug.cc:1:8: error: candidates are: struct A bug.cc:2:20: error: struct<unnamed>::A bug.cc: In function 'void foo(T) [with T = B]': bug.cc:13:10: instantiated from here bug.cc:8:3: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in check_dtor_name, at cp/call.c:247 Please submit a full bug report, [etc.] The bug affects the trunk, the 4.4 branch, and the 4.3 branch. The bug was introduced on the 4.3 branch after the release of GCC 4.3.3. -- Summary: [4.3/4.4/4.5 Regression] ICE with invalid destructor call Product: gcc Version: 4.5.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=40373