// { dg-additional-options "-fpreprocessed -std=gnu++20 -w -fconcepts" } int _M_invoke___functor; namespace std { template struct integral_constant { static constexpr bool value = __v; }; template struct decay { typedef int type; }; template struct enable_if; template struct enable_if { typedef _Tp type; }; template void __invoke_impl(_Fn __f, _Args... __args) { __f(__args...); } template void __invoke_r(_Callable __fn, _Args... __args) { using __result = int; using __type = __result; __invoke_impl<__type>(__fn, __args...); } template class function; template struct _Base_manager { static _Functor *_M_get_pointer(int) {} }; template class _Function_handler; template struct _Function_handler<_Res(_ArgTypes...), _Functor> { static _Res _M_invoke(_ArgTypes... __args) { auto __trans_tmp_1 = _Base_manager<_Functor>::_M_get_pointer(_M_invoke___functor); __invoke_r<_Res>(*__trans_tmp_1, __args...); } }; template struct function<_Res(_ArgTypes...)> { template function(_Functor) { _Function_handler<_Res(_ArgTypes...), _Functor>::_M_invoke; } }; template struct __shared_ptr_access { using element_type = _Tp; element_type *operator->(); }; template void make_shared(); } // namespace std namespace boost { using std::decay; using std::enable_if; using std::integral_constant; namespace asio { namespace detail { template struct is_completion_signature; template struct is_completion_signature : integral_constant {}; } // namespace detail template concept completion_signature = detail::is_completion_signature::value; template struct async_result; namespace detail { template struct async_result_has_initiate_memfn : integral_constant<1> {}; } // namespace detail template enable_if::value, decltype(async_result::type, Signatures...>::initiate(0))>::type async_initiate(Initiation) {} } // namespace asio } // namespace boost namespace malloy::websocket { struct connection { auto read(auto, auto done) { auto wrapper = [] {}; return boost::asio::async_initiate(wrapper); } }; } // namespace malloy::websocket namespace std { template struct coroutine_traits; template struct coroutine_handle { operator coroutine_handle<>(); static coroutine_handle from_address(void*); void* address(); }; struct suspend_always { bool await_ready(); void await_suspend(coroutine_handle<>); void await_resume(); }; } // namespace std namespace boost { namespace asio { namespace detail { using std::coroutine_handle; using std::suspend_always; template class awaitable_frame; } // namespace detail template struct awaitable { bool await_ready(); template void await_suspend(detail::coroutine_handle>); void await_resume(); }; namespace detail { struct awaitable_frame_base { auto initial_suspend() { return suspend_always(); } auto final_suspend() noexcept { struct result { bool await_ready() noexcept; void await_suspend(coroutine_handle<>) noexcept; void await_resume() noexcept; }; return result{}; } void unhandled_exception(); template auto await_transform(T a) { return a; } }; template <> struct awaitable_frame : awaitable_frame_base { awaitable get_return_object(); }; } // namespace detail } // namespace asio } // namespace boost namespace std { template struct coroutine_traits, Args...> { typedef boost::asio::detail::awaitable_frame promise_type; }; } // namespace std namespace boost { namespace asio { struct use_awaitable_t { use_awaitable_t(char, int, char); } use_awaitable(0, 0, 0); template struct async_result { template static awaitable initiate(Initiation); }; } // namespace asio } // namespace boost namespace malloy::test { void roundtrip_coro(std::function); } using boost::asio::awaitable; template awaitable client_ws_handler_coro() { std::__shared_ptr_access conn; auto buffer = std::make_shared; co_await conn->read(buffer, boost::asio::use_awaitable); } void port() { malloy::test::roundtrip_coro([](auto) { client_ws_handler_coro; }); }