2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Merge pull request #1222 from pps83/develop-inf-warn2

Fix clang warning when compiling with -ffast-math: use of infinity is undefined behavior due to the currently enabled floating-point options
This commit is contained in:
Matt Borland
2024-12-16 16:18:07 -05:00
committed by GitHub

View File

@@ -25,6 +25,7 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept
#if defined(__clang_major__) && __clang_major__ >= 6
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
#pragma clang diagnostic ignored "-Wnan-infinity-disabled"
#endif
return x == std::numeric_limits<T>::infinity() || -x == std::numeric_limits<T>::infinity();
#if defined(__clang_major__) && __clang_major__ >= 6