This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-10-26


1942. Incorrect reference to trailing-return-type

Section: 7.5.6  [expr.prim.lambda]     Status: CD4     Submitter: Mike Miller     Date: 2014-06-16

[Moved to DR at the May, 2015 meeting.]

According to 7.5.6 [expr.prim.lambda] paragraph 4,

If a lambda-expression does not include a lambda-declarator, it is as if the lambda-declarator were (). The lambda return type is auto, which is replaced by the trailing-return-type if provided...

trailing-return-type is a syntactic nonterminal that includes the -> and thus cannot be used directly to refer to the type. It should instead say something like, ...the type specified by the trailing-return-type.

The reference in 9.3.4.6 [dcl.fct] paragraph 2, “...returning trailing-return-type” should be similarly adjusted.

Proposed resolution (November, 2014):

  1. Change 7.5.6 [expr.prim.lambda] paragraph 4 as follows:

  2. If a lambda-expression does not include a lambda-declarator, it is as if the lambda-declarator were (). The lambda return type is auto, which is replaced by the type specified by the trailing-return-type if provided and/or deduced from return statements as described in 9.2.9.7 [dcl.spec.auto]. [Example:...
  3. Change 9.3.4.6 [dcl.fct] paragraph 2 as follows:

  4. The type of the declarator-id in D is “derived-declarator-type-list function of (parameter-declaration-clause) cv-qualifier-seqopt ref-qualifieropt returning trailing-return-type U, where U is the type specified by the trailing-return-type. The optional attribute-specifier-seq...