From 6bb937fa5f2a34a5b8515e94cad9ed8268a75e11 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 7 May 2020 14:35:47 +0300 Subject: [PATCH] Fixed compilation of gcd in C++20 mode with clang 10. Due to the new overload resolution rules for comparison operators in C++20, the comparison became ambiguous. --- include/boost/integer/common_factor_rt.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/integer/common_factor_rt.hpp b/include/boost/integer/common_factor_rt.hpp index 65f18d2..f9f26d3 100644 --- a/include/boost/integer/common_factor_rt.hpp +++ b/include/boost/integer/common_factor_rt.hpp @@ -129,7 +129,7 @@ namespace boost { BOOST_FORCEINLINE static BOOST_CXX14_CONSTEXPR unsigned make_odd(T& val) BOOST_GCD_NOEXCEPT(T) { unsigned r = 0; - while(0 == (val & 1u)) + while (T(0) == (val & 1u)) { #ifdef _MSC_VER // VC++ can't handle operator >>= in constexpr code for some reason val = val >> 1;