From c041fa9088872945129023c814b36ad9a8ed3b87 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Sat, 8 Aug 2026 17:32:38 +0200 Subject: [PATCH] Complete start_now with no senders --- include/exec/start_now.hpp | 1 + test/exec/async_scope/test_start_now.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/exec/start_now.hpp b/include/exec/start_now.hpp index f5f02e02e..b44523168 100644 --- a/include/exec/start_now.hpp +++ b/include/exec/start_now.hpp @@ -77,6 +77,7 @@ namespace experimental::execution constexpr __storage_base(_Env&& __env, std::size_t __pending) : __pending_(__pending) + , __joiner_(__pending == 0 ? nullptr : &__empty_joiner_) , __env_(__mkenv(static_cast<_Env&&>(__env), __source_)) {} diff --git a/test/exec/async_scope/test_start_now.cpp b/test/exec/async_scope/test_start_now.cpp index 47f1c80c3..d4d1c1131 100644 --- a/test/exec/async_scope/test_start_now.cpp +++ b/test/exec/async_scope/test_start_now.cpp @@ -26,6 +26,14 @@ namespace REQUIRE(executed); } + TEST_CASE("start_now zero", "[async_scope][start_now]") + { + async_scope scope; + auto stg = start_now(scope); + + REQUIRE(sync_wait(stg.async_wait()).has_value()); + } + TEST_CASE("start_now two", "[async_scope][start_now]") { bool executedA{false};