Skip to content

Conversation

@eisenwave
Copy link
Member

Fixes #8564.

In short, the goal is to harmonize with the wording in https://eel.is/c++draft/expr.sizeof

We already say in in <stddef.h> (C) and in [supper.types.layout] that ptrdiff_t is implementation-defined, and saying it a third time here is just silly.

@eisenwave eisenwave force-pushed the harmonize-ptrdiff-sizeof branch from d37c13b to b4ee30a Compare November 27, 2025 11:23
@eisenwave eisenwave added the P3-Other Triaged issue not in P1 or P2 label Nov 27, 2025
@frederick-vs-ja
Copy link
Contributor

I'm a bit uneasy about the current approach, because it seemingly makes some core language design specified in the library wording.

@eisenwave
Copy link
Member Author

We could also harmonize it the other way around, which is to remove all that wording from [support.types.layout] and pull it into core wording, but that seems like the bigger change.

In any case, it seems wrong to define what ptrdiff_t is on the fly, in the middle of describing pointer subtraction. It should have some dedicated paragraph. We don't do it like that for std::size_t, std::float32_t, or any other library aliases for core types either.

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

Labels

P3-Other Triaged issue not in P1 or P2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[expr.add] Harmonize wording for pointer subtraction/std::ptrdiff_t with [expr.sizeof]

2 participants