Skip to content

Commit 4e6d5b8

Browse files
fix(test): use module-exported names in get_scheduler() composition check
The final assertion named ex::__as_awaitable::__completes_inline, which is not part of the stdexec module's exported surface: the clang-trunk modules build rejected the name ("must be declared before it is used") and nvc++ could not resolve the namespace at all ("name followed by '::' must be a class or namespace name"), failing 4 CI configurations. Replace it with assertions on the exported per-tag concept: the composition's set_value_t completes inline (let_value forwards read_env's inline value completion), while its set_stopped_t does not (the nested schedule() completes asynchronously), so a co_await on it must not be treated as completing inline. Both hold on current main and fail at 482c260.
1 parent 74c6e71 commit 4e6d5b8

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎test/stdexec/queries/test_get_completion_behavior.cpp‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,18 @@ inline constexpr auto __reschedule = [](auto __sch)
8484
};
8585
inline constexpr auto __reschedule_on_current = ex::get_scheduler() | ex::let_value(__reschedule);
8686

87-
static_assert(
88-
!ex::__as_awaitable::__completes_inline<decltype(__reschedule_on_current), ex::env<>>);
87+
// For co_await, a sender is treated as completing inline only if _all_ of its
88+
// completion tags complete inline (see __as_awaitable::__completes_inline). The
89+
// nested schedule(sch) does not complete inline for set_stopped_t, so the
90+
// composition must not be classified as completing inline. We check the stopped
91+
// tag directly; the value tag of the composition _does_ complete inline
92+
// (let_value forwards read_env's inline value completion), so that is pinned
93+
// here as well. This check uses only names exported by the stdexec module: the
94+
// __as_awaitable namespace is not part of the module's public surface, and
95+
// naming it fails the modular and nvc++ configurations.
96+
static_assert(ex::__completes_inline<ex::set_value_t,
97+
ex::env_of_t<decltype(__reschedule_on_current)>,
98+
ex::env<>>);
99+
static_assert(!ex::__completes_inline<ex::set_stopped_t,
100+
ex::env_of_t<decltype(__reschedule_on_current)>,
101+
ex::env<>>);

0 commit comments

Comments
 (0)