Skip to content

Commit

Permalink
PR #1652: Avoid C++23 deprecation warnings from float_denorm_style
Browse files Browse the repository at this point in the history
Imported from GitHub PR #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 7be9635 into 7efc308

Merging this change closes #1652

COPYBARA_INTEGRATE_REVIEW=#1652 from pps83:float_denorm_style-warn 7be9635
PiperOrigin-RevId: 626124710
Change-Id: I5fc2b5758dcb3956164dbec1e8559f241a0d7bf7
  • Loading branch information
pps83 authored and copybara-github committed Apr 18, 2024
1 parent b85096e commit 0908376
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions absl/numeric/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ class numeric_limits<absl::uint128> {
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;
Expand Down Expand Up @@ -513,7 +515,9 @@ class numeric_limits<absl::int128> {
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;
Expand Down

0 comments on commit 0908376

Please sign in to comment.