diff --git a/include/beman/execution/detail/counting_scope_join.hpp b/include/beman/execution/detail/counting_scope_join.hpp index c5f76cde..f6360878 100644 --- a/include/beman/execution/detail/counting_scope_join.hpp +++ b/include/beman/execution/detail/counting_scope_join.hpp @@ -60,7 +60,8 @@ struct counting_scope_join_t { template static consteval auto get_completion_signatures() noexcept { - return ::beman::execution::completion_signatures<::beman::execution::set_value_t()>{}; + return ::beman::execution::completion_signatures<::beman::execution::set_value_t(), + ::beman::execution::set_stopped_t()>{}; } struct impls_for : ::beman::execution::detail::default_impls { struct get_state_impl { diff --git a/tests/beman/execution/CMakeLists.txt b/tests/beman/execution/CMakeLists.txt index 0f2aaab9..07e05189 100644 --- a/tests/beman/execution/CMakeLists.txt +++ b/tests/beman/execution/CMakeLists.txt @@ -89,6 +89,7 @@ list( issue-144.test issue-174.test issue-186.test + issue-313.test meta-combine.test meta-contains.test meta-filter.test diff --git a/tests/beman/execution/issue-313.test.cpp b/tests/beman/execution/issue-313.test.cpp new file mode 100644 index 00000000..8a70ae72 --- /dev/null +++ b/tests/beman/execution/issue-313.test.cpp @@ -0,0 +1,23 @@ +// tests/beman/execution/issue-313.test.cpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution; +#else +#include +#endif + +namespace ex = beman::execution; + +ex::task func() { + ex::simple_counting_scope scope; + co_await scope.join(); +} + +int main() { ex::sync_wait(func()); } diff --git a/tests/beman/execution/thread-stoptoken-intro.test.cpp b/tests/beman/execution/thread-stoptoken-intro.test.cpp index b25f095d..9c855a99 100644 --- a/tests/beman/execution/thread-stoptoken-intro.test.cpp +++ b/tests/beman/execution/thread-stoptoken-intro.test.cpp @@ -97,7 +97,7 @@ struct test_source : immovable { ::std::unique_lock guard(this->d_lock); this->d_cond.wait( guard, [this] { return this->d_in_progress == false || this->d_id == ::std::this_thread::get_id(); }); - ::std::exchange(this->d_callback, &this->d_no_call); + (void)::std::exchange(this->d_callback, &this->d_no_call); } }; } // namespace