Title
decltype((x)) in lambda-expressions
Status
cd5
Section
7.5.5 [expr.prim.lambda]
Submitter
Dinka Ranns

Created on 2014-04-15.00:00:00 last changed 40 months ago

Messages

Date: 2017-10-15.00:00:00

[Accepted as a DR as part of paper P0588R1 at the October, 2017 meeting.]

According to 7.5.5 [expr.prim.lambda] paragraph 19,

Every occurrence of decltype((x)) where x is a possibly parenthesized id-expression that names an entity of automatic storage duration is treated as if x were transformed into an access to a corresponding data member of the closure type that would have been declared if x were an odr-use of the denoted entity.

This formulation is problematic because it assumes that x can be captured and, if captured, would result in a member of the closure class. The former is not true if the lambda has no capture-default, and the latter is not guaranteed if the capture-default is &.

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: drafting -> cd5
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-04-15 00:00:00admincreate