This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


2324. Size of base class subobject

Section: 6.7.2  [intro.object]     Status: drafting     Submitter: GB     Date: 2017-02-27

P0488R0 comment GB 9

According to 6.7.2 [intro.object] paragraph 7,

Unless it is a bit-field (11.4.10 [class.bit]), a most derived object shall have a nonzero size and shall occupy one or more bytes of storage. Base class subobjects may have zero size.

Base class objects of zero size is a misleading term, as sizeof such an object is non-zero. Size should not be a property of an object, rather of a type.