diff --git a/include/exec/asio/completion_token.hpp b/include/exec/asio/completion_token.hpp index a725b9041..3c7dc3643 100644 --- a/include/exec/asio/completion_token.hpp +++ b/include/exec/asio/completion_token.hpp @@ -628,7 +628,7 @@ namespace ASIOEXEC_ASIO_NAMESPACE static type get(::exec::asio::detail::completion_token::completion_handler const & h, - Allocator const &) noexcept + ::STDEXEC::__ignore = {}) noexcept { return ::STDEXEC::get_allocator(::STDEXEC::get_env(h.state().r_)); } diff --git a/test/exec/asio/test_use_sender.cpp b/test/exec/asio/test_use_sender.cpp index f14c7d572..9fe7614b9 100644 --- a/test/exec/asio/test_use_sender.cpp +++ b/test/exec/asio/test_use_sender.cpp @@ -270,4 +270,21 @@ namespace CHECK(ctx.stopped()); } +#if !STDEXEC_NO_STDCPP_COROUTINES() + template + ::STDEXEC::task test_awaitable_in_stdexec_task(Timer& timer) + { + co_await timer.async_wait(::asio_impl::as_tuple(exec::asio::use_sender)); + } + + TEST_CASE("Can await an Asio-based asynchronous operation which uses use_sender as its " + "completion token from a stdexec task", + "[asioexec][use_sender]") + { + ::asio_impl::io_context ctx; + ::asio_impl::steady_timer timer(ctx); + CHECK_NOTHROW(test_awaitable_in_stdexec_task(timer)); + } +#endif // !STDEXEC_NO_STDCPP_COROUTINES() + } // namespace