From b9b1c8661ea77e3ab23699aafae1b593926a2c4e Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 13 May 2024 12:46:15 -0700 Subject: [PATCH] Suppress C++23 deprecation warnings for std::has_denorm and std::has_denorm_loss --- Eigen/src/Core/arch/Default/BFloat16.h | 14 ++++++++++++++ Eigen/src/Core/arch/Default/Half.h | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Eigen/src/Core/arch/Default/BFloat16.h b/Eigen/src/Core/arch/Default/BFloat16.h index f31c6cee6..9e79a39a4 100644 --- a/Eigen/src/Core/arch/Default/BFloat16.h +++ b/Eigen/src/Core/arch/Default/BFloat16.h @@ -139,8 +139,15 @@ struct numeric_limits_bfloat16_impl { static EIGEN_CONSTEXPR const bool has_infinity = true; static EIGEN_CONSTEXPR const bool has_quiet_NaN = true; static EIGEN_CONSTEXPR const bool has_signaling_NaN = true; +#if __cplusplus >= 202302L + EIGEN_DIAGNOSTICS(push) + EIGEN_DISABLE_DEPRECATED_WARNING +#endif static EIGEN_CONSTEXPR const std::float_denorm_style has_denorm = std::denorm_present; static EIGEN_CONSTEXPR const bool has_denorm_loss = false; +#if __cplusplus >= 202302L + EIGEN_DIAGNOSTICS(pop) +#endif static EIGEN_CONSTEXPR const std::float_round_style round_style = std::numeric_limits::round_style; static EIGEN_CONSTEXPR const bool is_iec559 = true; // The C++ standard defines this as "true if the set of values representable @@ -187,10 +194,17 @@ template EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl::has_quiet_NaN; template EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl::has_signaling_NaN; +#if __cplusplus >= 202302L +EIGEN_DIAGNOSTICS(push) +EIGEN_DISABLE_DEPRECATED_WARNING +#endif template EIGEN_CONSTEXPR const std::float_denorm_style numeric_limits_bfloat16_impl::has_denorm; template EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl::has_denorm_loss; +#if __cplusplus >= 202302L +EIGEN_DIAGNOSTICS(pop) +#endif template EIGEN_CONSTEXPR const std::float_round_style numeric_limits_bfloat16_impl::round_style; template diff --git a/Eigen/src/Core/arch/Default/Half.h b/Eigen/src/Core/arch/Default/Half.h index 9c195c12a..7754e8f27 100644 --- a/Eigen/src/Core/arch/Default/Half.h +++ b/Eigen/src/Core/arch/Default/Half.h @@ -208,8 +208,15 @@ struct numeric_limits_half_impl { static EIGEN_CONSTEXPR const bool has_infinity = true; static EIGEN_CONSTEXPR const bool has_quiet_NaN = true; static EIGEN_CONSTEXPR const bool has_signaling_NaN = true; +#if __cplusplus >= 202302L + EIGEN_DIAGNOSTICS(push) + EIGEN_DISABLE_DEPRECATED_WARNING +#endif static EIGEN_CONSTEXPR const std::float_denorm_style has_denorm = std::denorm_present; static EIGEN_CONSTEXPR const bool has_denorm_loss = false; +#if __cplusplus >= 202302L + EIGEN_DIAGNOSTICS(pop) +#endif static EIGEN_CONSTEXPR const std::float_round_style round_style = std::round_to_nearest; static EIGEN_CONSTEXPR const bool is_iec559 = true; // The C++ standard defines this as "true if the set of values representable @@ -256,10 +263,17 @@ template EIGEN_CONSTEXPR const bool numeric_limits_half_impl::has_quiet_NaN; template EIGEN_CONSTEXPR const bool numeric_limits_half_impl::has_signaling_NaN; +#if __cplusplus >= 202302L +EIGEN_DIAGNOSTICS(push) +EIGEN_DISABLE_DEPRECATED_WARNING +#endif template EIGEN_CONSTEXPR const std::float_denorm_style numeric_limits_half_impl::has_denorm; template EIGEN_CONSTEXPR const bool numeric_limits_half_impl::has_denorm_loss; +#if __cplusplus >= 202302L +EIGEN_DIAGNOSTICS(pop) +#endif template EIGEN_CONSTEXPR const std::float_round_style numeric_limits_half_impl::round_style; template