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

2024-11-11


2817. sizeof(abstract class) is underspecified

Section: 7.6.2.5  [expr.sizeof]     Status: open     Submitter: Jiang An     Date: 2023-02-23

Subclause 7.6.2.5 [expr.sizeof] paragraph 1 specifies:

The sizeof operator yields the number of bytes occupied by a non-potentially-overlapping object of the type of its operand. The operand is either an expression, which is an unevaluated operand (7.2.3 [expr.context]), or a parenthesized type-id. ...

Since an abstract class can be used only in a situation where it is a potentially-overlapping object, it is unclear what its size is.