chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.98k stars 1.22k forks source link

Calling experimental::coro::async_resume within awaitable fails to compile with MSVC #1179

Open dvd0bvb opened 1 year ago

dvd0bvb commented 1 year ago

Using a coro object in a coroutine fails to compile with the latest version of MSVC throwing the following syntax error coming from coro.hpp. This happens with both the boost and standalone versions of asio.

C:/data/libraries/installed/x64-windows/include\boost/asio/experimental/impl/coro.hpp(1144): error C2059: syntax error: '->'

You can see a minimal example and the full output in godbolt here. Note that gcc compiles the example fine so it seems to be an MSVC issue. I haven't been able to repro without asio yet but will submit a bug report to them as well.

dvd0bvb commented 1 year ago

A bug report already existed https://developercommunity.visualstudio.com/t/Syntax-Error-when-using-boost::asio::exp/10224448