------- Comment #7 from redi at gcc dot gnu dot org 2010-08-19 12:32 ------- testcase from Bug 45334 reduced to a single file:
struct Base { virtual ~Base(); }; Base::~Base() {} struct Derived : Base { virtual ~Derived(); void foo(); }; Derived::~Derived() {} void Derived::foo() { Base *b = this; Base &br = *b; } int main() { Derived d; d.foo(); Base *b = &d; } Within Derived::foo b has type void* Breakpoint 1, Derived::foo (this=0x7fffffffe5f0) at bug.cc:18 18 Base *b = this; (gdb) ptype b type = void * -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44645