chriskohlhoff / asio

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

GCC 13.2 compiler cannot resolve overloaded spawn in boost 1.86 #1524

Open Wedge009 opened 2 months ago

Wedge009 commented 2 months ago

Not sure if this is an issue with boost - downstream issue is https://github.com/wesnoth/wesnoth/issues/9284

Wesnoth compiles cleanly with boost 1.85. With boost 1.86, gcc gives the following error (for example) on calls of spawn:

error: call of overloaded ‘spawn(boost::asio::io_service&, wesnothd::server::handle_new_client(socket_ptr)::<lambda(boost::asio::yield_context)>)’ is ambiguous

Only by explicitly setting a completion token can Wesnoth compile with boost 1.86 (as per https://github.com/wesnoth/wesnoth/issues/9284#issuecomment-2330396456).

Any advice, please?

Osyotr commented 2 months ago

Minimal reproducer: https://godbolt.org/z/6c1PWMsb3 https://github.com/jgaa/restc-cpp/issues/160

Wedge009 commented 2 months ago

Thank you for that!

Wedge009 commented 1 month ago

Reviewing the documentation for the function as of boost 1.80 does indeed state that the form without a completion token is supposed to be deprecated. Perhaps this isn't exactly the behaviour that's desired for boost, but it does indicate the intention is for the completion token to be explicitly given.