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

Consider this diamond with a non-virtual base duplicated. What does sizeof(D) reveal about the object layout under a typical Itanium-ABI implementation, and why?

struct A { int x; }; struct B : A { int y; }; struct C : A { int z; }; struct D : B, C { int w; }; // A is NOT virtual