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.
make-state<Rcvr>::state-type::complete uses Env which is not in scopeSection: 33.9.12.12 [exec.when.all] Status: New Submitter: Abhinav Agarwal Opened: 2026-05-12 Last modified: 2026-05-17
Priority: Not Prioritized
View other active issues in [exec.when.all].
View all other issues in [exec.when.all].
View all issues with New status.
Discussion:
In 33.9.12.12 [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().
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.
Proposed resolution:
This wording is relative to N5046.
Modify 33.9.12.12 [exec.when.all] as indicated:
-15- The member
void state-type::complete(Rcvr& rcvr) noexceptbehaves as follows:
(15.1) — If
dispis equal todisposition::started, evaluates: […](15.2) — Otherwise, if
dispis equal todisposition::error, evaluates: […](15.3) — Otherwise, evaluates:
if constexpr (sends-stopped) { on_stop.reset(); set_stopped(std::move(rcvr)); }where
sends-stoppedequals true if and only if there exists an elementSofSndrssuch thatcompletion_signatures_of_t<S, when-all-env<containsEnvenv_of_t<Rcvr>>>set_stopped_t().