This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
task should move its resultSection: 33.13.6.5 [task.promise] Status: New Submitter: Robert A.H. Leahy Opened: 2025-11-05 Last modified: 2025-11-08
Priority: Not Prioritized
View other active issues in [task.promise].
View all other issues in [task.promise].
View all issues with New status.
Discussion:
In 33.13.6.5 [task.promise] there's the following bullet (7.3):
set_value(std::move(RCVR(*this)), *result).
This has the effect of sending the result as an lvalue whereas an rvalue is almost certainly what's intended, see the bullet (7.1) above:
set_error(std::move(RCVR(*this)), std::move(e)) […]
Resolution would be to change the bullet (7.3) to:
set_value(std::move(RCVR(*this)), *std::move(result)).
[2025-11-07; This would be resolved by LWG 4339(i).]
Proposed resolution:
This wording is relative to N5014.
Modify 33.13.6.5 [task.promise], as indicated:
auto final_suspend() noexcept;-7- Returns: An awaitable object of unspecified type (7.6.2.4 [expr.await]) whose member functions arrange for the completion of the asynchronous operation associated with
STATE(*this)by invoking:
- (7.1) —
set_error(std::move(RCVR(*this)), std::move(e))iferrors.index()is greater than zero andeis the value held byerrors, otherwise- (7.2) —
set_value(std::move(RCVR(*this)))ifis_void<T>istrue, and otherwise- (7.3) —
set_value(std::move(RCVR(*this)), *std::move(result)).