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.

4359. as_awaitable(expr, p) does not define semantics of call if p is not an lvalue

Section: 33.13.1 [exec.as.awaitable] Status: New Submitter: Lewis Baker Opened: 2025-08-27 Last modified: 2026-01-16

Priority: 2

View other active issues in [exec.as.awaitable].

View all other issues in [exec.as.awaitable].

View all issues with New status.

Discussion:

The wording in 33.13.1 [exec.as.awaitable] p7 defines the semantics of a call to as_awaitable(expr, p) where p is an lvalue. However, it does not specify what the behaviour is if p is not an lvalue.

We should probably say that as_awaitable(expr, p) is ill-formed if p is not an lvalue.

[2026-01-16; Reflector poll.]

Set priority to 2 after reflector poll.

Previous resolution [SUPERSEDED]:

This wording is relative to N5014.

  1. Modify 33.13.1 [exec.as.awaitable] as indicated:

    -7- as_awaitable is a customization point object. For subexpressions expr and p where p is an lvalue, Expr names the type decltype((expr)) and Promise names the type decay_t<decltype((p))>, if p is not an lvalue, as_awaitable(expr, p) is ill-formed, otherwise as_awaitable(expr, p) is expression-equivalent to, except that the evaluations of expr and p are indeterminately sequenced:

[2026-01-16; Jonathan provides updated wording]

Proposed resolution:

This wording is relative to N5032.

  1. Modify 33.13.1 [exec.as.awaitable] as indicated:

    -7- as_awaitable is a customization point object. For subexpressions expr and p where p is an lvalue, Expr names the type decltype((expr)) and Promise names the type decay_t<decltype((p))>, as_awaitable(expr, p) is ill-formed if p is not an lvalue, otherwise as_awaitable(expr, p) is expression-equivalent to the expression specified below, except that the evaluations of expr and p are indeterminately sequenced: