Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++ODR and linkageSingle-choice MCQ

Two TUs define `struct S` with member layouts that differ only in the order of two members. The program links and runs. What is the precise status under the ODR?

// a.cpp struct S { int a; double b; }; // b.cpp struct S { double b; int a; }; // same name, reordered members