Title
make-state<Rcvr>::state-type::complete uses `Env` which is not in scope
Status
ready
Section
[exec.when.all]
Submitter
Abhinav Agarwal

Created on 2026-05-12.00:00:00 last changed 7 days ago

Messages

Date: 2026-05-30.15:28:42

Proposed resolution:

This wording is relative to N5046.

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

    -15- The member void state-type::complete(Rcvr& rcvr) noexcept behaves as follows:

    1. (15.1) — If `disp` is equal to disposition::started, evaluates: […]

    2. (15.2) — Otherwise, if `disp` is equal to disposition::error, evaluates: […]

    3. (15.3) — Otherwise, evaluates:

      if constexpr (sends-stopped) {
        on_stop.reset();
        set_stopped(std::move(rcvr));
      }
      

      where sends-stopped equals true if and only if there exists an element `S` of `Sndrs` such that completion_signatures_of_t<S, when-all-env<Envenv_of_t<Rcvr>>> contains `set_stopped_t()`.

Date: 2026-05-15.00:00:00

[ 2026-05-29; Reflector poll. ]

Set status to Tentatively Ready after five votes in favour during reflector poll.

Date: 2026-05-12.00:00:00

In [exec.when.all], the specification of make-state::state-type::complete (paragraph 15, bullet (15.3)) defines sends-stopped as true if and only if there exists an element `S` of `Sndrs` such that

completion_signatures_of_t<S, when-all-env<Env>>

contains `set_stopped_t()`.

However, no declaration named `Env` is in scope at this point. state-type is specified in the context of make-state<Rcvr>::operator()<Sndrs...>; the relevant named template parameters there are `Rcvr` and `Sndrs...`. `Env` is a template parameter of check-types<Sndr, Env...>, which is a separate member function whose scope does not extend into make-state.

Other environment-dependent wording within the make-state scope uses env_of_t<Rcvr>:

  • The `stop_callback` alias (paragraph 12 within the make-state class template synopsis) uses stop_callback_for_t<stop_token_of_t<env_of_t<Rcvr>>, on-stop-request>

  • The `values_tuple` alias (paragraph 13) uses value_types_of_t<Sndrs, FWD-ENV-T(env_of_t<Rcvr>), […]>

The sends-stopped definition in bullet (15.3) is the only use of bare `Env` in this scope.

This issue was introduced by P3887R1 ("Make when_all a Ronseal Algorithm"), whose wording contains the same text.

History
Date User Action Args
2026-05-30 15:28:42adminsetmessages: + msg16352
2026-05-30 15:28:42adminsetstatus: new -> ready
2026-05-17 09:50:04adminsetmessages: + msg16299
2026-05-12 00:00:00admincreate