From 91b38c31b6a04cee40fdb1e08de38dd08ed6fbf7 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 2 Dec 2024 23:32:08 +1100 Subject: [PATCH] Fix ambiguous overloads error with clang 19. --- .../asio/execution/blocking_adaptation.hpp | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/asio/include/asio/execution/blocking_adaptation.hpp b/asio/include/asio/execution/blocking_adaptation.hpp index 412fbaa192..89f4424a89 100644 --- a/asio/include/asio/execution/blocking_adaptation.hpp +++ b/asio/include/asio/execution/blocking_adaptation.hpp @@ -470,6 +470,36 @@ const T disallowed_t::static_query_v; #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template +struct is_blocking_adaptation_t : false_type +{ +}; + +template +struct is_blocking_adaptation_t> : true_type +{ +}; + +template +struct is_allowed_t : false_type +{ +}; + +template +struct is_allowed_t> : true_type +{ +}; + +template +struct is_disallowed_t : false_type +{ +}; + +template +struct is_disallowed_t> : true_type +{ +}; + template class adapter { @@ -509,7 +539,10 @@ class adapter template enable_if_t< - can_query::value, + can_query::value + && !is_blocking_adaptation_t::value + && !is_allowed_t::value + && !is_disallowed_t::value, query_result_t > query(const Property& p) const noexcept(is_nothrow_query::value) @@ -525,7 +558,10 @@ class adapter template enable_if_t< - can_require::value, + can_require::value + && !is_blocking_adaptation_t::value + && !is_allowed_t::value + && !is_disallowed_t::value, adapter>> > require(const Property& p) const noexcept(is_nothrow_require::value) @@ -536,7 +572,10 @@ class adapter template enable_if_t< - can_prefer::value, + can_prefer::value + && !is_blocking_adaptation_t::value + && !is_allowed_t::value + && !is_disallowed_t::value, adapter>> > prefer(const Property& p) const noexcept(is_nothrow_prefer::value)