Skip to content

[basic.fundamental] Harmonize "Type X is a distinct type..." wordings#8762

Open
Quuxplusone wants to merge 1 commit intocplusplus:mainfrom
Quuxplusone:distinct-type.topic
Open

[basic.fundamental] Harmonize "Type X is a distinct type..." wordings#8762
Quuxplusone wants to merge 1 commit intocplusplus:mainfrom
Quuxplusone:distinct-type.topic

Conversation

@Quuxplusone
Copy link
Contributor

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.

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.
@eisenwave eisenwave added the P2-Bug Presentational errors and omissions label Mar 2, 2026
@eisenwave
Copy link
Member

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2-Bug Presentational errors and omissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants