diff --git a/include/boost/math/ccmath/isinf.hpp b/include/boost/math/ccmath/isinf.hpp index f5f3f71a2b..b775e86ee4 100644 --- a/include/boost/math/ccmath/isinf.hpp +++ b/include/boost/math/ccmath/isinf.hpp @@ -23,9 +23,11 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept if constexpr (std::numeric_limits::is_signed) { #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" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wtautological-constant-compare" +# if __clang_major__ >= 18 +# pragma clang diagnostic ignored "-Wnan-infinity-disabled" +# endif #endif return x == std::numeric_limits::infinity() || -x == std::numeric_limits::infinity(); #if defined(__clang_major__) && __clang_major__ >= 6