asio icon indicating copy to clipboard operation
asio copied to clipboard

GCC 13.2 compiler cannot resolve overloaded spawn in boost 1.86

Open Wedge009 opened this issue 1 year ago • 3 comments

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?

Wedge009 avatar Sep 05 '24 01:09 Wedge009

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

Osyotr avatar Sep 24 '24 21:09 Osyotr

Thank you for that!

Wedge009 avatar Sep 24 '24 21:09 Wedge009

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.

Wedge009 avatar Sep 30 '24 06:09 Wedge009