Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++multiple and virtual inheritance layoutSingle-choice MCQ

A class D derives non-virtually from two bases B1 and B2, each of which has its own virtual functions. In the Itanium C++ ABI, how is the address of a complete D object related to the B2 subobject pointer used for virtual dispatch through a B2*?

struct B1 { virtual void f(); long a; }; struct B2 { virtual void g(); long b; }; struct D : B1, B2 { void f() override; void g() override; };