Title
Attributes for return statements in lambdas
Status
c++11
Section
7.5.5 [expr.prim.lambda]
Submitter
Daveed Vandevoorde

Created on 2010-02-18.00:00:00 last changed 123 months ago

Messages

Date: 2010-11-15.00:00:00

[Voted into the WP at the November, 2010 meeting.]

Date: 2010-09-15.00:00:00

Proposed resolution (September, 2010):

Change 7.5.5 [expr.prim.lambda] bullet 4.1 as follows:

  • if the compound-statement is of the form

      { return attribute-specifieropt return expression ; }

    the type of the returned expression after lvalue-to-rvalue conversion (7.3.2 [conv.lval]), array-to-pointer conversion (7.3.3 [conv.array]), and function-to-pointer conversion (7.3.4 [conv.func]);

Date: 2022-02-18.07:47:23

7.5.5 [expr.prim.lambda] bullet 4.1 says,

if the compound-statement if [sic] of the form

    { return attribute-specifieropt expression ; }

the type of the returned expression...

The problem (besides the typo “if”) is that the attribute-specifier for a return statement precedes, rather than following, the keyword (Clause 8 [stmt.stmt] paragraph 1).

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetstatus: dr -> fdis
2010-11-29 00:00:00adminsetmessages: + msg3150
2010-11-29 00:00:00adminsetstatus: tentatively ready -> dr
2010-10-18 00:00:00adminsetmessages: + msg2972
2010-10-18 00:00:00adminsetstatus: drafting -> tentatively ready
2010-08-23 00:00:00adminsetstatus: open -> drafting
2010-02-18 00:00:00admincreate