diff --git a/include/beman/execution26/detail/as_awaitable.hpp b/include/beman/execution26/detail/as_awaitable.hpp index 2bd267eb..0366b386 100644 --- a/include/beman/execution26/detail/as_awaitable.hpp +++ b/include/beman/execution26/detail/as_awaitable.hpp @@ -32,11 +32,11 @@ struct as_awaitable_t { return ::std::forward(expr).as_awaitable(promise); } else if constexpr (::beman::execution26::detail:: is_awaitable) { - return (void(promise), ::std::forward(expr)); + return ::std::forward(expr); } else if constexpr (::beman::execution26::detail::awaitable_sender) { return ::beman::execution26::detail::sender_awaitable{::std::forward(expr), promise}; } else { - return (void(promise), ::std::forward(expr)); + return ::std::forward(expr); } } }; diff --git a/include/beman/execution26/detail/unspecified_promise.hpp b/include/beman/execution26/detail/unspecified_promise.hpp index 406493f3..e22ddff2 100644 --- a/include/beman/execution26/detail/unspecified_promise.hpp +++ b/include/beman/execution26/detail/unspecified_promise.hpp @@ -9,8 +9,8 @@ namespace beman::execution26::detail { struct unspecified_promise { auto get_return_object() noexcept -> unspecified_promise; - auto initial_suspend() noexcept -> unspecified_promise; - auto final_suspend() noexcept -> unspecified_promise; + auto initial_suspend() noexcept -> ::std::suspend_never; + auto final_suspend() noexcept -> ::std::suspend_never; void unhandled_exception() noexcept; void return_void() noexcept; auto unhandled_stopped() noexcept -> ::std::coroutine_handle<>; diff --git a/tests/beman/execution26/exec-with-awaitable-senders.test.cpp b/tests/beman/execution26/exec-with-awaitable-senders.test.cpp index 7b1c8d84..e7c0e06d 100644 --- a/tests/beman/execution26/exec-with-awaitable-senders.test.cpp +++ b/tests/beman/execution26/exec-with-awaitable-senders.test.cpp @@ -30,7 +30,7 @@ struct coroutine : std::coroutine_handle { struct promise : exec::with_awaitable_senders { coroutine get_return_object() { return {coroutine::from_promise(*this)}; } std::suspend_always initial_suspend() noexcept { return {}; } - std::suspend_always final_suspend() noexcept { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; @@ -58,21 +58,9 @@ coroutine test_mix_awaitable_and_sender() { ASSERT(value == 1); } -int main() { - { - coroutine coro = test_await_tuple(); - coro.resume(); - coro.destroy(); - } - { - coroutine coro = test_await_void(); - coro.resume(); - coro.destroy(); - } +TEST(exec_with_awaitable_senders) { + test_await_tuple().resume(); + test_await_void().resume(); test_sync_wait_awaitable(); - { - coroutine coro = test_mix_awaitable_and_sender(); - coro.resume(); - coro.destroy(); - } + test_mix_awaitable_and_sender().resume(); } \ No newline at end of file