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.

4438. Bad expression in [exec.when.all]

Section: 33.9.12.12 [exec.when.all] Status: New Submitter: Eric Niebler Opened: 2025-10-30 Last modified: 2025-10-31

Priority: Not Prioritized

View all other issues in [exec.when.all].

View all issues with New status.

Discussion:

33.9.12.12 [exec.when.all] p5 reads as follows:

-5- Let make-when-all-env be the following exposition-only function template:

template<class Env>
  constexpr auto make-when-all-env(inplace_stop_source& stop_src,        // exposition only
                                   Env&& env) noexcept {
  return see below;
}

Returns an object e such that

The problem is with "state.stop-src.get_token()" in bullet (5.2). There is no state object here. This expression should be stop_src.get_token().

Proposed resolution:

This wording is relative to N5014.

  1. Modify 33.9.12.12 [exec.when.all] as indicated:

    -5- Let make-when-all-env be the following exposition-only function template:

    template<class Env>
      constexpr auto make-when-all-env(inplace_stop_source& stop_src,        // exposition only
                                       Env&& env) noexcept {
      return see below;
    }
    

    Returns an object e such that

    • (5.1) — decltype(e) models queryable, and
    • (5.2) — e.query(get_stop_token) is expression-equivalent to state.stop-srcstop_src.get_token(), and
    • (5.3) — given a query object q with type other than cv stop_token_t and whose type satisfies forwarding-query, e.query(q) is expression-equivalent to get_env(rcvr).query(q).