22545 – [3.4 Regression] ICE with pointer to class member & user defined conversion operator (original) (raw)
Description Paul Woegerer 2005-07-18 12:17:39 UTC
Compiling the example below with g++ from snapshot 4.1.0 20050716 causes the following error message:
g++ -S cpp_parse_internal_error.cpp
cpp_parse_internal_error.cpp: In function 'int main()': cpp_parse_internal_error.cpp:23: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_complete, at cp/call.c:1567
Compiling the same example with 3.4.4 works perfectly and correctly returns 13 as result. The behaviour does not depend on the optimization level (O0, O3 all the same)
------------------------------------------- cpp_parse_internal_error.cpp
struct A { int member; A() : member(13) {} };
A a;
struct B { operator A*() { return &a; } };
B b;
int A::* member_pntr = &A::member;
int main() { // That one WORKS // A a_pntr = b; // return a_pntr -> member_pntr;
// But this one causes an INTERNAL ERROR return b ->* member_pntr; }
Comment 1 Drea Pinski 2005-07-18 14:10:41 UTC
Confirmed, 3.4 ICEs when checking is turned on too. Likewise for 4.0.0.
Comment 2 Drea Pinski 2005-07-22 21:13:26 UTC
Moving to 4.0.2 pre Mark.
Comment 3 Volker Reichelt 2005-07-25 11:47:21 UTC
Smaller testcase:
====================== struct A { operator A*(); };
void foo(int A::* p) { A() ->* p; }
Comment 6 Mark Mitchell 2005-07-28 19:16:05 UTC
Fixed in 4.0.2.
Comment 7 Volker Reichelt 2005-09-01 09:15:30 UTC
Taking care of the backport to the 3.4 branch.
Comment 9 Volker Reichelt 2005-09-01 11:50:49 UTC
Fixed also on the 3.4 branch.