This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Accepted as a DR at the February, 2019 meeting.]
According to 7.5.6 [expr.prim.lambda] paragraph 6,
The closure type for a non-genericlambda-expression withnolambda-capture has a public non-virtual non-explicitconst conversion function to pointer to function with C ++language linkage (9.12 [dcl.link]) having the sameparameter and return types as the closure type's function calloperator. The value returned by this conversion function shall bethe address of a function that, when invoked, has the same effectas invoking the closure type's function call operator.
This does not mention the object for which the function calloperator would be invoked (although since there is no capture,presumably the function call operator makes no use of theobject pointer). This could be addressed by relating thebehavior of the function call operator to a notional temporary,or the function call operator for such closure classes could bemade static.
Proposed resolution (January, 2019):
Change 7.5.6.2 [expr.prim.lambda.closure] paragraph 7 as follows,splitting it into two paragraphs:
...The value returned by this conversion function is theaddress of a functionF that, when invoked, has thesame effect as invoking the closure type's function calloperatoron a default-constructed instance of theclosure type.F is a constexpr function ifthe function call operator is a constexpr function.
For a generic lambda withnolambda-capture, the closure type has...
Change 7.5.6.2 [expr.prim.lambda.closure] paragraph 9 as follows:
The value returned by any given specialization of thisconversion function template is the address of a functionFthat, when invoked, has the same effect as invoking thegeneric lambda's corresponding function call operatortemplate specializationon a default-constructed instanceof the closure type.Fis a constexpr function if thecorresponding specialization is a constexprfunctionand is an immediate function if the functioncall operator template specialization is an immediatefunction. [Note: This will result...