Created on 2019-10-15.00:00:00 last changed 7 months ago
Proposed resolution (February, 2020):
Change 126.96.36.199 [dcl.spec.auto] paragraph 2 as follows:
A placeholder-type-specifier of the form type-constraintopt auto can be used
inthe decl-specifier-seq of a parameter-declaration of a function declaration or lambda-expression and signifies that the function is an abbreviated function template (188.8.131.52 [dcl.fct]) or the lambda is a generic lambda (7.5.5 [expr.prim.lambda]).
Change 184.108.40.206 [dcl.fct] paragraph 18 as follows:
An abbreviated function template is a function declaration
whose parameter-type-list includesone or more placeholders (220.127.116.11 [dcl.spec.auto]). An abbreviated function template is equivalent to a function template (18.104.22.168 [temp.over.link]) whose template-parameter-list includes one invented type template-parameter for each occurrence of aplaceholder type in the decl-specifier-seq of a parameter-declaration in the function's parameter-type-list, in order of appearance. For a placeholder-type-specifier of the form...
Change 7.5.5 [expr.prim.lambda] paragraph 5 as follows:
A lambda is a generic lambda if
there is a decl-specifier that is a placeholder-type-specifier in the decl-specifier-seq of a parameter-declaration ofthe lambda-expression , or if the lambda has a template-parameter-list. [Example:...
This resolution also resolves issue 2053.
[Accepted at the February, 2020 (Prague) meeting.]
The current wording for abbreviated function templates could lead to the incorrect conclusion that f and g in the example below are well-formed abbreviated function templates. The g case is the abbreviated function template analog of issue 2053 regarding generic lambdas.
22.214.171.124 [dcl.spec.auto] paragraph 4 clearly disallows the ap case. The inconsistency between the paragraph 2 wording for abbreviated function templates and the paragraph 4 wording is unintentional.
template <typename> struct A; void f(A<auto> x); void g(auto f() -> int); A<auto> *ap = static_cast<A<int> *>(0);
|2020-12-15 00:00:00||admin||set||messages: + msg6457|