------- Comment #1 from redi at gcc dot gnu dot org 2010-06-30 22:28 ------- conversion from derived* to vbase* involves adjusting a pointer
in the context of vbase::set_p the value returned from me() is converted to vbase* so the pointer is adjusted try changing derived::me() to this: int b; derived* me() { cout << "derived::me() = " << this << endl; cout << "derived::me() as vbase = " << (vbase*)this << endl; return this; }; you will see that the value is different, and the second value is the one assigned to ::p -- redi at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44733