Quoth the standard in [class.prop]/3:
A class S is a standard-layout class if it:
- has the same access control for all non-static data members,
My understanding (and perhaps I'm mistaken) has always been that C++ access controls do not affect the physical layout of a class in any way -- they're purely a compile-time mechanism to enhance encapsulation. (Or to put it another way, changing a member from private to public is not an ABI-breaking change.)
If this is the case, then what is the reason for this restriction for standard-layout classes?