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
[basic.def.odr] Adds note that x may be part of a qualified id #1996
Conversation
Please add the section label to the start of your commit message. Please squash your commits. |
source/basic.tex
Outdated
@@ -355,7 +355,8 @@ | |||
\end{itemize} | |||
|
|||
\pnum | |||
A variable \tcode{x} whose name appears as a | |||
A variable \tcode{x} whose name appears, possibly as part of a | |||
\grammarterm{qualified-id}, as a | |||
potentially-evaluated expression \tcode{ex} is \defn{odr-used} by \tcode{ex} unless |
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.
Would this read better if it said "A variable x whose name appears as a potentially-evaluated expression ex (possibly as part of a qualified-id), is odr-used by ex unless..."?
In general, I'm not convinced this change is a net improvement to start with. In the immediately preceding paragraph, we talk about a "function named by an expression", and qualified-ids are also included there, but not explicitly called out. Calling out qualified-ids in one place, but not another, makes the appearance of a difference where there is none.
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.
If you have a static variable referenced by Widget::x
, is that covered by the term name? A "function named by an expression" imo carries a better implication of optionally being qualified.
I don't expect this pr's proposed wording to be accepted.
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.
How about this:
A variable
x
that is named by a potentially-evaluated expressionex
([expr.prim.id]) is odr-used [...]
This "whose name appears" wording is problematically vague. For example:
int a;
void f(int a) { a = 0 }; // odr-uses ::a?
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 like @zygoloid's suggestion.
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.
done
384f958
to
53137df
Compare
bac9908
to
18c6909
Compare
source/basic.tex
Outdated
A variable \tcode{x} whose name appears as a | ||
potentially-evaluated expression \tcode{ex} is \defn{odr-used} by \tcode{ex} unless | ||
A variable \tcode{x} that is named by a potentially-evaluated expression | ||
\tcode{ex}~(\ref{expr.prim.id}) is \defn{odr-used} by \tcode{ex} unless |
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.
Can you use the \iref
macro here instead?
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.
done
Looks good to me. |
I think @zygoloid was still concerned by the potential loss of clarity that it's now no longer clear whether the expression is in its entirety the thing that names |
Hmm, perhaps if we switch from passive to active voice:
|
e3dbfe2
to
1a21a65
Compare
@ryanhaining Could you please rebase and apply Richard's suggestion? |
Yes, sorry you caught me in the middle of two back-to-back trips so might take me a bit, I'm having a really hard time with hotspots so just doing a pull is taking a while. |
Okay, ready for review. |
I think the rewording of https://wg21.link/p1787r6 improved the text sufficiently to resolve the original issue. Please double-check, and feel free to reopen if you would still like to tweak the wording further. |
Following from https://stackoverflow.com/questions/47952024
I'm sure there's a better way to word this.