From 0908376f89f90feae0a15dba7f9b1fde9df6e3b6 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 18 Apr 2024 13:00:54 -0700 Subject: PR #1652: Avoid C++23 deprecation warnings from float_denorm_style Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1652 this change fixes errors emitted by MS compiler: ``` 1>C:\abseil-cpp\absl\numeric\int128.h(278,20): error C4996: 'std::float_denorm_style': warning STL4042: std::float_denorm_style, std::numeric_limits::has_denorm, and std::numeric_limits::has_denorm_loss are deprecated in C++23. You can define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to suppress this warning. ``` Merge 7be96350012559b2b3f3b705cb06088e0a6aaf0d into 7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf Merging this change closes #1652 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1652 from pps83:float_denorm_style-warn 7be96350012559b2b3f3b705cb06088e0a6aaf0d PiperOrigin-RevId: 626124710 Change-Id: I5fc2b5758dcb3956164dbec1e8559f241a0d7bf7 --- absl/numeric/int128.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'absl/numeric') diff --git a/absl/numeric/int128.h b/absl/numeric/int128.h index 562d5e58..5a067d17 100644 --- a/absl/numeric/int128.h +++ b/absl/numeric/int128.h @@ -270,7 +270,9 @@ class numeric_limits { static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; + ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING static constexpr float_denorm_style has_denorm = denorm_absent; + ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING static constexpr bool has_denorm_loss = false; static constexpr float_round_style round_style = round_toward_zero; static constexpr bool is_iec559 = false; @@ -513,7 +515,9 @@ class numeric_limits { static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; + ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING static constexpr float_denorm_style has_denorm = denorm_absent; + ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING static constexpr bool has_denorm_loss = false; static constexpr float_round_style round_style = round_toward_zero; static constexpr bool is_iec559 = false; -- cgit v1.2.3