-
Notifications
You must be signed in to change notification settings - Fork 751
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
base: main
Are you sure you want to change the base?
Conversation
71c0a21
to
9206390
Compare
9206390
to
237904c
Compare
source/expressions.tex
Outdated
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}. |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…cv-qualification' with 'more cv-qualified'
237904c
to
67dab85
Compare
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