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

2024-12-19


2966. Alignment and value representation of std::nullptr_t

Section: 6.8.2  [basic.fundamental]     Status: open     Submitter: Jiang An     Date: 2024-11-22

(From submission #644.)

While 6.8.2 [basic.fundamental] paragraph 16 specifies the size of std::nullptr_t, it is silent on any alignment requirements. Furthermore, unlike in C23, there is no statement about the value representation of std::nullptr_t.

Possible resolution:

Change in 6.8.2 [basic.fundamental] paragraph 16 as follows:

The types denoted by cv std::nullptr_t are distinct types. A value of type std::nullptr_t is a null pointer constant (7.3.12 [conv.ptr]). Such values participate in the pointer and the pointer-to-member conversions (7.3.12 [conv.ptr], 7.3.13 [conv.mem]). sizeof(std::nullptr_t) shall be equal to sizeof(void*). The size (7.6.2.5 [expr.sizeof]) and alignment requirement (6.7.3 [basic.align]) of the type std::nullptr_t are those of the type "pointer to void". [ Note: The value representation can comprise no bits (7.3.2 [conv.lval]). -- end note ]