Skip to content
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

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

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 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
source/overloading.tex Outdated Show resolved Hide resolved
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
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"
3 participants