This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Moved to DR at the November, 2014 meeting.]
One of the criteria for a standard-layout class inClause 11 [class] paragraph 7 is:
either has no non-static data members in the most derivedclass and at most one base class with non-static datamembers, or has no base classes with non-static datamembers,
In an example like
struct B { int i; }; struct C : B { }; struct D : C { };this could be read as indicating thatD is not astandard-layout class, since it has two base classes, one directand one indirect, that each have a non-static data member. Theintent should be clarified.
See alsoissue 1881 for a relatedquestion about standard-layout classes.
Proposed resolution (June, 2014):
Change Clause 11 [class] paragraph 7 as follows:
Astandard-layout class is a class that:
has no non-static data members of typenon-standard-layout class (or array of such types) orreference,
has no virtual functions (11.7.3 [class.virtual]) andno virtual base classes (11.7.2 [class.mi]),
has the same access control (11.8 [class.access]) for all non-static datamembers,
has no non-standard-layout base classes,
has at most one base class subobject of any giventype,
either has no non-static data members in the most derived classand at most one base class with non-static data members, or hasno base classes with non-static data membershas allnon-static data members and bit-fields in the class and its baseclasses first declared in the same class, andhas no base classes of the same type as the first non-static datamember.109
[Example:
struct B { int i; }; // standard-layout class struct C : B { }; // standard-layout class struct D : C { }; // standard-layout class struct E : D { char : 4; }; // not a standard-layout class struct Q {}; struct S : Q { }; struct T : Q { }; struct U : S, T { }; // not a standard-layout class—end example]
This resolution also resolvesissue 1881.
(See also the related changes in the resolution ofissue 1672.)