[basic.fundamental] Harmonize "Type X is a distinct type..." wordings#8762
[basic.fundamental] Harmonize "Type X is a distinct type..." wordings#8762Quuxplusone wants to merge 1 commit intocplusplus:mainfrom
Conversation
Types are types; types do not denote types. Here I don't know if there might be a reason we talk about cv nullptr_t being multiple distinct *types*, as if otherwise the reader might imagine const nullptr_t to be the same type as volatile nullptr_t. Otherwise, that sentence should clearly be just "std::nullptr_t is a distinct type." Notably `std::meta::info` is *not* currently described as a distinct type. I don't think that's intentional; I think it's practically required to be a distinct type anyway. So I think this diff is editorial.
|
There are some pretty chaotic inconsistencies in there, and the use of "denotes" is pretty dubious. |
| The types denoted by \cv~\tcode{std::nullptr_t} are distinct types. | ||
| Type \tcode{std::nullptr_t} is a distinct type. | ||
| A prvalue of type \tcode{std::nullptr_t} is a null pointer | ||
| constant\iref{conv.ptr}. Such values participate in the pointer and the |
There was a problem hiding this comment.
The sentence I'm modifying here was added by CWG2689 "Are cv-qualified std::nullptr_t fundamental types?" in 2024.
Incidentally, I wonder whether the previous emphasis on cv nullptr_t was supposed to imply something here: that maybe prvalues of type, say, volatile nullptr_t are not null pointer constants? Would that be detectable in any way?
I think it might be impossible to form a prvalue of type const nullptr_t or volatile nullptr_t, though. Certainly one can't do it via [conv.lval]: "A glvalue of a non-function, non-array type T can be converted to a prvalue. [...] If T is a non-class type, the type of the prvalue is the cv-unqualified version of T. [...] If T is cv std::nullptr_t, the result is a null pointer constant."
Types are types; types do not denote types.
Here I don't know if there might be a reason we talk about cv nullptr_t being multiple distinct types, as if otherwise the reader might imagine const nullptr_t to be the same type as volatile nullptr_t. Otherwise, that sentence should clearly be just "std::nullptr_t is a distinct type."
Notably
std::meta::infois not currently described as a distinct type. I don't think that's intentional; I think it's practically required to be a distinct type anyway. So I think this diff is editorial.