struct A { virtual void foo() {} }; struct B { virtual void bar() {} }; struct X : B, A { void foo(); }; void X::foo() { void* p = this; }