Title
auto in non-generic lambdas
Status
c++20
Section
9.2.9.6 [dcl.spec.auto]
Submitter
Faisal Vali

Created on 2014-12-07.00:00:00 last changed 7 months ago

Messages

Date: 2020-02-15.00:00:00

Proposed resolution (February, 2020):

This issue is resolved by the resolution of issue 2447.

Date: 2020-02-15.00:00:00

[Accepted as a DR at the February, 2020 (Prague) meeting.]

According to 9.2.9.6 [dcl.spec.auto] paragraph 3,

If the auto type-specifier appears as one of the decl-specifiers in the decl-specifier-seq of a parameter-declaration of a lambda-expression, the lambda is a generic lambda (7.5.5 [expr.prim.lambda]).

and 7.5.5 [expr.prim.lambda] paragraph 5 says,

For a generic lambda, the closure type has a public inline function call operator member template (13.7.3 [temp.mem]) whose template-parameter-list consists of one invented type template-parameter for each occurrence of auto in the lambda's parameter-declaration-clause, in order of appearance.

However, an auto that signals a trailing-return-type should be excluded from these descriptions.

History
Date User Action Args
2020-12-15 00:00:00adminsetmessages: + msg6455
2020-12-15 00:00:00adminsetstatus: drafting -> c++20
2014-12-07 00:00:00admincreate