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
[Motion cwg 7] P2915R0 (Proposed resolution for CWG1223) #6329
Conversation
9679385
to
8b1bd98
Compare
source/statements.tex
Outdated
@@ -1081,7 +1081,8 @@ | |||
conversion\iref{expr.type.conv} as its leftmost subexpression can be | |||
indistinguishable from a \grammarterm{declaration} where the first | |||
\grammarterm{declarator} starts with a \tcode{(}. In those cases the | |||
\grammarterm{statement} is a \grammarterm{declaration}. | |||
\grammarterm{statement} is a declaration, |
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.
\grammarterm{statement} is a declaration, | |
\grammarterm{statement} is a \grammarterm{declaration}, |
Restore the change by commit 8b1bd98.
That's bogus because \grammarterm
is for uses,
not definitions (which happen in a special LaTeX environment).
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.
One cannot say that a grammar production rule is another grammar production rule. Hence, this was an attempt to improve the wording, taking advantage of the fact that "declaration" is loosely used as a term, so it's possible to alter/embellish/clarify it's definition. This change also follows existing precedence.
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.
We have ambiguous grammar, and this sentence says whether you take one or the other choice. Since grammar is presented as non-terminals expanding to other non-terminals, it seems plausible to say "is a declaration" (i.e. is this branch, not the other one).
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.
Ok to say "is to be considered a declaration"? That way we're claiming it's a rule rather than saying it is a rule, and we've used that wording elsewhere so it has precedence.
I reverted the change and added "to be considered" in a separate commit. Note that it's in a separate commit so the editor can choose to apply it (or not) at his discretion.
source/statements.tex
Outdated
A syntactically ambiguous statement that can syntactically be | ||
a \grammarterm{declaration} with an outermost \grammarterm{declarator} | ||
with a \grammarterm{trailing-return-type} | ||
is a declaration only if it starts with \keyword{auto}. |
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.
is a declaration only if it starts with \keyword{auto}. | |
is a \grammarterm{declaration} only if it starts with \keyword{auto}. |
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.
... likewise ...
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.
Fixed original commit to follow paper (as suggested) and added "to be considered" in a separate commit.
source/declarations.tex
Outdated
whose outermost \grammarterm{abstract-declarator} | ||
would match the grammar of an \grammarterm{abstract-declarator} | ||
with a \grammarterm{trailing-return-type} | ||
is to be considered a \grammarterm{type-id} only if it starts with \keyword{auto}. |
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'm using https://isocpp.org/files/papers/P2915R0.pdf to review.
It actually says
is to be considered a \grammarterm{type-id} only if it starts with \keyword{auto}. | |
is a \grammarterm{type-id} only if it starts with \keyword{auto}. |
which is more consistent with the other additions.
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 disagree - it makes no sense for something to be a grammarterm. A grammarterm names a production rule, a purely lexical construct - it is its rule. "is to be considered" isn't right either, but at least we're not trying to redefine a rule.
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.
Fixed original commit to follow paper (as suggested) and added "to be considered" in a separate commit.
55527d8
to
1028cf7
Compare
1028cf7
to
c1a717e
Compare
Editorial notes: - [dcl.ambig.res] Use "is to be considered a" instead of "is" to avoid redefining the grammar production /type-id/. - [stmt.ambig] Likewise, don't use \grammarterm "declaration" in "is a declaration" to avoid redefining /declaration/. - [stmt.ambig] Reword comment in example for consistency.
c1a717e
to
c9f1f46
Compare
The additional editorial change seems useful, but would it be enough to say "is considered a type-id" instead of "is to be considered a type-id"? |
Works for me. |
c9f1f46
to
1cf424e
Compare
This avoids suggesting that any \grammarterms are being (re)defined.
ef29146
to
9b9ebcc
Compare
Fixes #6282.
Fixes cplusplus/papers#1596
Notes: