Skip to content

[expr.static.cast], [over.call.object] Replace 'greater cv-qualification' with 'more cv-qualified' #7050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eisenwave
Copy link
Contributor

@Eisenwave Eisenwave commented Jun 5, 2024

Fixes #7048.

Generally, the strategy is to replace "same cv-qualification, or greater cv-qualification" with "at least as cv-qualified", which is much shorter and more natural. "At least as" is arguably not a defined term (unlike "more cv-qualified"), but I believe it naturally stems from the defined term. If we really wanted to, we could defined "at least as cv-qualified" and "more cv-qualified" more strictly, but I don't believe it's entirely necessary to do so.

Note that there is precedent for "at least as cv-qualified" in https://eel.is/c++draft/expr.cond#4.3.1

@Eisenwave Eisenwave force-pushed the more-cv-qualified branch from 71c0a21 to 9206390 Compare June 5, 2024 12:56
@Eisenwave Eisenwave changed the title [expr.static.cast] Replace 'greater cv-qualification' with 'more cv-qualified' [expr.static.cast], [over.call.object] Replace 'greater cv-qualification' with 'more cv-qualified' Jun 5, 2024
@Eisenwave Eisenwave force-pushed the more-cv-qualified branch from 9206390 to 237904c Compare June 6, 2024 12:36
@Eisenwave Eisenwave requested a review from jensmaurer June 11, 2024 14:45
if \cvqual{cv2} is the
same cv-qualification as, or greater cv-qualification than,
\cvqual{cv1}. If \tcode{B} is a virtual base class of \tcode{D}
if \cvqual{cv2}~\tcode{D} is at least as cv-qualified as \cvqual{cv1}~\tcode{B}.
Copy link
Contributor

Choose a reason for hiding this comment

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

I am concerned that const int "is at least as cv-qualified" as volatile int, but not "the same or greater".

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. We only have a partial order here.

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 PR now uses the wording "equally as or more cv-qualified than" (also fixes [expr.cond]), which should be unambiguous even with only a partial order.

Copy link
Contributor

Choose a reason for hiding this comment

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

Progress, but I remain concerned that "equally as cv-qualified" does not mean "has the same cv-qualification" due to our partial ordering.

@Eisenwave Eisenwave force-pushed the more-cv-qualified branch from 237904c to 67dab85 Compare June 18, 2024 14:59
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[expr.static.cast], [basic.type.qualifier] "More cv-qualified" vs "greater cv-qualification"
4 participants