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
[dcl.spec.auto.general] Definition of _generic parameter type placeholder_ can be simplified #4904
Comments
[dcl.spec.auto.general] p2 is basically discussing the placeholder types of the parameters of a function or lambda. It simply says "auto type-specifier introducing a trailing-return-type" is not considered as a generic parameter type placeholder. I think they are not redundant and it is significant to clarify which placeholder types can be a generic parameter type placeholders. |
But can the "auto type-specifier introducing a trailing-return-type" be "a decl-specifier of the decl-specifier-seq of a parameter-declaration of a function declaration or lambda-expression"? It reads to me as if "the auto in 'auto f() -> T' appears in the declaration of a parameter". Could it be to account for a case like auto f(auto(*)()->int) -> int; |
Yes, it is permitted by the grammar of the parameter-declaration defined at [dcl.fct] p3. Hence,
It is valid but the parameter is not considered to have a generic parameter type placeholder, it does not form the abbreviate function template. Paragraph 2 can be read as
|
Thank you. So the intention is to prevent |
The paragraph in question, p2, lists two places in the grammar where a placeholder-type-specifier of the form type-constraintopt
auto
can appear. It leaves one unused and defines a name for the other.The two are mutually exclusive:
All the paragraph does is define a name for the former. The latter, redundantly excluded, also complicates the surrounding wording which could otherwise read simpler.
Note that this might be concurrently modified, as the paragraph or its subclause seem to have more problems as pointed out at https://bugs.llvm.org/show_bug.cgi?id=51856#c3.
The text was updated successfully, but these errors were encountered: