-
Notifications
You must be signed in to change notification settings - Fork 662
Description
Version of Beast
Boost 1.86.0
Steps necessary to reproduce the problem
Sample code and godbolt (yes I know this minimum example is contrived, but I don't want to share awful code know what's intellectual property and what isn't in this section of the codebase).
#include <boost/beast/core.hpp>
#include <boost/beast/websocket.hpp>
namespace bb = boost::beast;
extern boost::beast::websocket::stream<boost::beast::tcp_stream>* stream_;
extern void onConnect(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type::endpoint_type);
void onResolve(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results) {
boost::beast::get_lowest_layer(*stream_).async_connect(
results, [](auto ec, auto endpoint) { onConnect(ec, endpoint); });
}
Simple "solution" is to change auto endpoint
to boost::asio::ip::tcp::resolver::results_type::endpoint_type
... but I have absolutely no idea if this changes function generation / execution compared to what's intended; it appears as though this is a mixed Asio/Beast bug. Reduced to a few commits in Boost Asio / Boost Beast, specifically:
- Boost Beast @ Boost 1.85 and Boost Asio @ Boost 1.85 are fine together.
- Boost Asio introduced boostorg/asio@6ce241c which caused (can also cause?) stream.async_connect() ambiguous overload with asio::as_tuple(asio::use_awaitable) #2867
- 1a2b85b was introduced via Fix overloads that are ambiguous when using default completion tokens #2893 to fix stream.async_connect() ambiguous overload with asio::as_tuple(asio::use_awaitable) #2867
Asio had no release notes available in the Boost release, I suspect this is a case of "Asio changed a default, Beast changed [to fix ambiguity in #2867 via #2893] but introduced a different behavior change by accident."
All relevant compiler information
I can't think of anything that is particularly relevant, but GCC 13.3 (or 14.2); -std=c++26
is enough to trigger this.