1
0
Fork 0
firefox/third_party/opentelemetry-cpp/patches/fix-ambiguous-holds_alternative.patch
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
920 B
Diff

diff --git a/api/include/opentelemetry/std/variant.h b/api/include/opentelemetry/std/variant.h
index 58bc510c5f622..c665c7945f4f7 100644
--- a/api/include/opentelemetry/std/variant.h
+++ b/api/include/opentelemetry/std/variant.h
@@ -220,9 +220,13 @@ inline constexpr bool holds_alternative(const variant<Ts...> &v) noexcept
return v.index() == I;
}
-template <typename T, typename... Ts>
-inline constexpr bool holds_alternative(const variant<Ts...> &v) noexcept
+template <typename T, template<typename...> typename U, typename... Ts>
+inline constexpr bool holds_alternative(const U<Ts...> &v) noexcept
{
+ // Clang 18.1.7 on Ubuntu 24.04 does not disambiguate between this
+ // and std::holds_alternative if argument type is std::variant<Ts...>
+ static_assert(std::is_same_v<U<Ts...>, std::variant<Ts...>>,
+ "Unsupported argument type");
return std::holds_alternative<T, Ts...>(v);
}