The following invalid code snippet causes an ICE on mainline: ===================== struct A;
void foo() { int A::* p; A a; a.*p; } ===================== bug.cc: In function 'void foo()': bug.cc:6: error: aggregate 'A a' has incomplete type and cannot be defined bug.cc:7: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in build_m_component_ref, at cp/typeck2.c:1215 Please submit a full bug report, [etc.] -- Summary: [4.2 regression] ICE with ptr-to-member of incomplete class 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=27805