Description
Full name of submitter (unless configured in github; will be published with the issue): Anoop Rana
Reference (section label): [basic.fundamental]
Link to reflector thread (if any):
Issue description:
Currently basic.fundamental#14 says:
A value of type
std::nullptr_t
is a null pointer constant. Such values participate in the pointer and the pointer-to-member conversions ([conv.ptr], [conv.mem]).sizeof(std::nullptr_t)
shall be equal to sizeof(void*).
(emphasis mine)
Note the emphasis on the term "value". My point is that the above clause seems to be mainly talking about "value" instead of "type" while it should be mainly talking about the "type" std::nullptr_t
which is defined in cstddef.syn inside namespace std
.
This matters because basic.fundamental#15 says:
The types described in this subclause are called fundamental types. [ Note: Even if the implementation defines two or more fundamental types to have the same value representation, they are nevertheless different types. — end note ]
(emphasis mine)
Again note that the above clause talks about "types described" instead of "types of values described" in this subclause. Though this doesn't seem to be a big problem as one can assume that "types described" is the same as "types of value described", I suggest that we should instead move atleast part of the non-normative note to basic.fundamental#14.
Suggested resolution:
Change basic.fundamental#14 to as highlighted(in bold) below:
std::nullptr_t
is a distinct type that is neither a pointer type nor a pointer-to-member type. A value of typestd::nullptr_t
is a null pointer constant. Such values participate in the pointer and the pointer-to-member conversions ([conv.ptr], [conv.mem]).sizeof(std::nullptr_t)
shall be equal tosizeof(void*
)..
As we can see the note from lex.nullptr is taken and is added into basic.fundamental#14.
Moroever if needed a separate note can be added into basic.fundamental#15 saying as highlighted(in bold) below:
The types described in this subclause are called fundamental types.
[ Note: Even if the implementation defines two or more fundamental types to have the same value representation, they are nevertheless different types. — end note ]
[Note: Even thoughstd::nullptr_t
is declared incstddef
, it is still considered a fundamental type --end note]
Note that the above added note is the second change that this issue suggests.