This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-07-27
(From submission #721.)
Subclause 9.6.4 [dcl.fct.def.coroutine] paragraph 3 and paragraph 4 do not properly handle function call operators of lambdas that are coroutines. In particular, *this does not denote the lambda's closure object and a captureless lambda should be treated like a static member function, because the result of a captureless lambda's conversion function does not take a pointer to the closure object.
Possible resolution:
Change in 9.6.4 [dcl.fct.def.coroutine] paragraph 3 as follows:
The promise type of a coroutine is std::coroutine_traits<R, P1 , . . . , Pn >::promise_type, where R is the return type of the function, and P1 . . . Pn is the sequence of types of the non-object function parameters, preceded by the type of the object parameter (9.3.4.6 [dcl.fct]) if the coroutine is a non-static member function that is not a member of the closure type for a lambda-expression with no lambda-capture and no explicit object parameter (7.5.6.2 [expr.prim.lambda.closure]). The promise type shall be a class type.
Change in 9.6.4 [dcl.fct.def.coroutine] paragraph 4 as follows:
A this-eligible function is an implicit object member function that is not a member of the closure type for a lambda-expression with no lambda-capture. In the following, pi is an lvalue of type Pi , where p1 denotes the object parameter and pi+1 denotes the ith non-object function parameter foran implicit object memberthis-eligible function, and pi denotes the ith function parameter otherwise. Foran implicit object memberthis-eligible function, q1 is an lvalue that denotes *this or, if the function is a member of a closure type, the closure object; any other qi is an lvalue that denotes the parameter copy corresponding to pi , as described below.