-
Notifications
You must be signed in to change notification settings - Fork 752
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
Avoid ambiguity of placeholder on nested parameter #7454
Avoid ambiguity of placeholder on nested parameter #7454
Conversation
source/declarations.tex
Outdated
@@ -1779,7 +1779,8 @@ | |||
\opt{\grammarterm{type-constraint}} \keyword{auto}. | |||
The placeholder type shall appear | |||
as one of the \grammarterm{decl-specifier}{s} in | |||
the \grammarterm{decl-specifier-seq} or | |||
the \grammarterm{decl-specifier-seq} or, | |||
in case of function pointer type, |
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 not convinced this is a good change. At the very least, reference-to-function types should be included, too.
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 see your point.
I will try to a better way, unless you have suggestions.
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.
Proposed a new way, not sure whether for p5 it was really needed to repeat the same note.
Signed-off-by: Mauro Russo <[email protected]>
e589a2a
to
afc0ac3
Compare
Hm... I think this entire change is unnecessary. We clearly say "the type of a parameter-declaration of a function declaration" (not "function type"). A nested function type is not a function declaration. We had situations where we said "in", and those were considered ambiguous whether applying to the top level or to nested levels. We believe we've addressed this by using "of", which we believe linguistically excludes nested levels. The standard is not a tutorial. |
ok, you are saying that, despite we have 'IN' during the clarifying wording "... The placeholder type shall appear as one of the [decl-specifier]s IN the [decl-specifier-seq] ...", If, in addition, the term 'THE' in the aforementioned wording "... in THE [decl-specifier-seq] ..." is a non-ambiguous reference to the one directly related to the original [parameter-declaration], then ok to me. |
For the "IN" decl-specifier-seq, "of" would work well (and be slightly better), but (as you correctly observe), there is no recursion going on via the decl-specifier-seq. For "THE decl-specifier-seq", I think there is none in sight here where "THE" could refer to other than the one of the parameter-declaration. |
This PR is related to the Issue #7453 proposing multiple changes to clarify the text in [dcl.spec.auto.general]
However, a PR has been created for each specific change.
In [dcl.spec.auto.general]-p2 and p5, an additional text about the case of function type, may avoid the general interpretation of using a placeholder type for nested parameters.