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

A program defines two different class types named `Widget`, one in each of two `.cpp` files at namespace scope (no anonymous namespace), with different members. The program compiles and links. What does the standard say?

// a.cpp struct Widget { int x; }; // b.cpp struct Widget { double y; double z; };