On Thu, Apr 9, 2026 at 2:18 PM Fernando Pelliccioni <[email protected]> wrote:
> Ping. Original patch from 2026-03-26: > > https://gcc.gnu.org/pipermail/gcc-patches/2026-March/711525.html > > Implements P2614R2 (deprecate numeric_limits::has_denorm, has_denorm_loss, > and float_denorm_style) for libstdc++. Already implemented by libc++ and > MSVC STL. > > Thanks, > Fernando > > On Thu, Mar 26, 2026 at 11:58 PM Fernando Pelliccioni < > [email protected]> wrote: > >> Deprecate numeric_limits::has_denorm, numeric_limits::has_denorm_loss, >> and the float_denorm_style enum as specified by P2614R2 (C++23). >> >> The deprecation uses _GLIBCXX23_DEPRECATED on the member declarations, >> with #pragma GCC diagnostic push/pop to suppress warnings from the >> deprecated float_denorm_style type within the header itself. Internal >> uses of has_denorm (e.g. in is_iec559 initialization) are also wrapped >> with diagnostic suppression. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/limits (float_denorm_style): Deprecate. >> (has_denorm, has_denorm_loss): Deprecate in all specializations. >> Suppress deprecated warnings for internal uses in is_iec559. >> * include/bits/max_size_type.h (has_denorm, has_denorm_loss): >> Deprecate. >> * testsuite/18_support/numeric_limits/char16_32_t.cc: Suppress >> the deprecation warning. >> > I would prefer using dg-prune-output in the file, that targets the deprecation warnings from has_denorm, instead of blanket removal of all deprecated warnings. > * testsuite/18_support/numeric_limits/char8_t.cc: Likewise. >> * testsuite/18_support/numeric_limits/denorm_min.cc: Likewise. >> * testsuite/18_support/numeric_limits/dr559.cc: Likewise. >> * >> testsuite/18_support/numeric_limits/requirements/constexpr_data.cc: >> Likewise. >> * >> testsuite/18_support/numeric_limits/specialization_default_values.cc: >> Likewise. >> * testsuite/std/ranges/iota/max_size_type.cc: Likewise. >> * testsuite/18_support/numeric_limits/deprecated-2b.cc: New test. >> >> Signed-off-by: Fernando Pelliccioni <[email protected]> >> --- >> libstdc++-v3/include/bits/max_size_type.h | 14 +- >> libstdc++-v3/include/std/limits | 209 ++++++++++++++---- >> .../18_support/numeric_limits/char16_32_t.cc | 1 + >> .../18_support/numeric_limits/char8_t.cc | 1 + >> .../18_support/numeric_limits/denorm_min.cc | 1 + >> .../numeric_limits/deprecated-2b.cc | 28 +++ >> .../18_support/numeric_limits/dr559.cc | 1 + >> .../requirements/constexpr_data.cc | 1 + >> .../specialization_default_values.cc | 1 + >> .../std/ranges/iota/max_size_type.cc | 1 + >> 10 files changed, 213 insertions(+), 45 deletions(-) >> create mode 100644 >> libstdc++-v3/testsuite/18_support/numeric_limits/deprecated-2b.cc >> >> diff --git a/libstdc++-v3/include/bits/max_size_type.h >> b/libstdc++-v3/include/bits/max_size_type.h >> index 042aad10a13..cc7fe2d0396 100644 >> --- a/libstdc++-v3/include/bits/max_size_type.h >> +++ b/libstdc++-v3/include/bits/max_size_type.h >> @@ -791,9 +791,12 @@ namespace ranges >> static constexpr bool has_infinity = false; >> static constexpr bool has_quiet_NaN = false; >> static constexpr bool has_signaling_NaN = false; >> - static constexpr bool has_denorm_loss = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> + static constexpr bool has_denorm_loss _GLIBCXX23_DEPRECATED = >> false; >> static constexpr bool tinyness_before = false; >> - static constexpr float_denorm_style has_denorm = denorm_absent; >> + static constexpr float_denorm_style has_denorm >> _GLIBCXX23_DEPRECATED = denorm_absent; >> +#pragma GCC diagnostic pop >> static constexpr float_round_style round_style = round_toward_zero; >> >> static constexpr _Sp >> @@ -858,9 +861,12 @@ namespace ranges >> static constexpr bool has_infinity = false; >> static constexpr bool has_quiet_NaN = false; >> static constexpr bool has_signaling_NaN = false; >> - static constexpr bool has_denorm_loss = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> + static constexpr bool has_denorm_loss _GLIBCXX23_DEPRECATED = >> false; >> static constexpr bool tinyness_before = false; >> - static constexpr float_denorm_style has_denorm = denorm_absent; >> + static constexpr float_denorm_style has_denorm >> _GLIBCXX23_DEPRECATED = denorm_absent; >> +#pragma GCC diagnostic pop >> static constexpr float_round_style round_style = round_toward_zero; >> >> static constexpr _Dp >> diff --git a/libstdc++-v3/include/std/limits >> b/libstdc++-v3/include/std/limits >> index f0ba2851a0a..b4f53866a20 100644 >> --- a/libstdc++-v3/include/std/limits >> +++ b/libstdc++-v3/include/std/limits >> @@ -186,7 +186,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> * These values represent the presence or absence of a variable number >> * of exponent bits. This type is used in the std::numeric_limits >> class. >> */ >> - enum float_denorm_style >> + enum >> + _GLIBCXX23_DEPRECATED >> + float_denorm_style >> { >> /// Indeterminate at compile time whether denormalized values are >> allowed. >> denorm_indeterminate = -1, >> @@ -270,11 +272,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> >> /** See std::float_denorm_style for more information. */ >> - static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = >> denorm_absent; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> + static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> >> /** True if loss of accuracy is detected as a denormalization loss, >> rather than as an inexact result. */ >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> /** True if-and-only-if the type adheres to the IEC 559 standard, >> also >> known as IEEE 754. (Only makes sense for floating point types.) >> */ >> @@ -426,9 +433,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR bool >> infinity() _GLIBCXX_USE_NOEXCEPT { return false; } >> @@ -496,9 +507,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR >> char infinity() _GLIBCXX_USE_NOEXCEPT { return char(); } >> @@ -564,9 +579,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR signed char >> infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed >> char>(0); } >> @@ -635,9 +654,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR unsigned char >> infinity() _GLIBCXX_USE_NOEXCEPT >> @@ -707,9 +730,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR wchar_t >> infinity() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } >> @@ -771,9 +798,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR char8_t >> infinity() _GLIBCXX_USE_NOEXCEPT { return char8_t(); } >> @@ -836,8 +867,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static constexpr bool has_infinity = false; >> static constexpr bool has_quiet_NaN = false; >> static constexpr bool has_signaling_NaN = false; >> - static constexpr float_denorm_style has_denorm = denorm_absent; >> - static constexpr bool has_denorm_loss = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> + static constexpr float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static constexpr bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static constexpr char16_t >> infinity() noexcept { return char16_t(); } >> @@ -897,8 +933,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static constexpr bool has_infinity = false; >> static constexpr bool has_quiet_NaN = false; >> static constexpr bool has_signaling_NaN = false; >> - static constexpr float_denorm_style has_denorm = denorm_absent; >> - static constexpr bool has_denorm_loss = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> + static constexpr float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static constexpr bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static constexpr char32_t >> infinity() noexcept { return char32_t(); } >> @@ -963,9 +1004,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR short >> infinity() _GLIBCXX_USE_NOEXCEPT { return short(); } >> @@ -1032,9 +1077,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR unsigned short >> infinity() _GLIBCXX_USE_NOEXCEPT >> @@ -1103,9 +1152,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR int >> infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } >> @@ -1172,9 +1225,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR unsigned int >> infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<unsigned >> int>(0); } >> @@ -1242,9 +1299,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR long >> infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } >> @@ -1311,9 +1372,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR unsigned long >> infinity() _GLIBCXX_USE_NOEXCEPT >> @@ -1384,9 +1449,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR long long >> infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long >> long>(0); } >> @@ -1454,9 +1523,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_absent; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR unsigned long long >> infinity() _GLIBCXX_USE_NOEXCEPT >> @@ -1523,9 +1596,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> \ >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ >> +_Pragma("GCC diagnostic push") \ >> +_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ >> + _GLIBCXX23_DEPRECATED \ >> = denorm_absent; \ >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss \ >> + _GLIBCXX23_DEPRECATED = false; \ >> +_Pragma("GCC diagnostic pop") \ >> \ >> static _GLIBCXX_CONSTEXPR TYPE \ >> infinity() _GLIBCXX_USE_NOEXCEPT \ >> @@ -1592,9 +1670,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; >> \ >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ >> +_Pragma("GCC diagnostic push") \ >> +_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ >> + _GLIBCXX23_DEPRECATED \ >> = denorm_absent; \ >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss \ >> + _GLIBCXX23_DEPRECATED = false; \ >> +_Pragma("GCC diagnostic pop") \ >> \ >> static _GLIBCXX_CONSTEXPR unsigned TYPE \ >> infinity() _GLIBCXX_USE_NOEXCEPT >> \ >> @@ -1713,10 +1796,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = >> __FLT_HAS_INFINITY__; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = >> __FLT_HAS_QUIET_NAN__; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = >> has_quiet_NaN; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED >> = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent; >> static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED >> = __glibcxx_float_has_denorm_loss; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR float >> infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); } >> @@ -1730,8 +1818,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_CONSTEXPR float >> denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; } >> >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR bool is_iec559 >> = has_infinity && has_quiet_NaN && has_denorm == denorm_present; >> +#pragma GCC diagnostic pop >> static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; >> static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; >> >> @@ -1788,10 +1879,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = >> __DBL_HAS_INFINITY__; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = >> __DBL_HAS_QUIET_NAN__; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = >> has_quiet_NaN; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED >> = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent; >> static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED >> = __glibcxx_double_has_denorm_loss; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR double >> infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); } >> @@ -1805,8 +1901,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_CONSTEXPR double >> denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; } >> >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR bool is_iec559 >> = has_infinity && has_quiet_NaN && has_denorm == denorm_present; >> +#pragma GCC diagnostic pop >> static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; >> static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; >> >> @@ -1863,10 +1962,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_USE_CONSTEXPR bool has_infinity = >> __LDBL_HAS_INFINITY__; >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = >> __LDBL_HAS_QUIET_NAN__; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = >> has_quiet_NaN; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED >> = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent; >> static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED >> = __glibcxx_long_double_has_denorm_loss; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR long double >> infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); } >> @@ -1880,8 +1984,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> static _GLIBCXX_CONSTEXPR long double >> denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; } >> >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR bool is_iec559 >> = has_infinity && has_quiet_NaN && has_denorm == denorm_present; >> +#pragma GCC diagnostic pop >> static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; >> static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; >> >> @@ -1956,10 +2063,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> = __glibcxx_concat3 (__FLT, BITSIZE, _HAS_QUIET_NAN__); \ >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN \ >> = has_quiet_NaN; \ >> +_Pragma("GCC diagnostic push") \ >> +_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") >> \ >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ >> + _GLIBCXX23_DEPRECATED \ >> = bool(__glibcxx_concat3 (__FLT, BITSIZE, _HAS_DENORM__)) \ >> ? denorm_present : denorm_absent; \ >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss \ >> + _GLIBCXX23_DEPRECATED = false; \ >> +_Pragma("GCC diagnostic pop") \ >> \ >> static _GLIBCXX_CONSTEXPR _Float##BITSIZE >> \ >> infinity() _GLIBCXX_USE_NOEXCEPT \ >> @@ -1977,8 +2089,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> denorm_min() _GLIBCXX_USE_NOEXCEPT \ >> { return __glibcxx_concat3 (__FLT, BITSIZE, _DENORM_MIN__); } \ >> \ >> +_Pragma("GCC diagnostic push") \ >> +_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ >> static _GLIBCXX_USE_CONSTEXPR bool is_iec559 \ >> = has_infinity && has_quiet_NaN && has_denorm == denorm_present;\ >> +_Pragma("GCC diagnostic pop") \ >> static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ >> static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; \ >> \ >> @@ -2055,9 +2170,14 @@ __glibcxx_float_n(128) >> static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN >> = __BFLT16_HAS_QUIET_NAN__; >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = >> has_quiet_NaN; >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> + _GLIBCXX23_DEPRECATED >> = bool(__BFLT16_HAS_DENORM__) ? denorm_present : denorm_absent; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR __gnu_cxx::__bfloat16_t >> infinity() _GLIBCXX_USE_NOEXCEPT >> @@ -2075,8 +2195,11 @@ __glibcxx_float_n(128) >> denorm_min() _GLIBCXX_USE_NOEXCEPT >> { return __BFLT16_DENORM_MIN__; } >> >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR bool is_iec559 >> = has_infinity && has_quiet_NaN && has_denorm == denorm_present; >> +#pragma GCC diagnostic pop >> static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; >> static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; >> >> @@ -2155,9 +2278,13 @@ __glibcxx_float_n(128) >> #else >> static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; >> #endif >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" >> static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm >> - = denorm_present; >> - static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; >> + _GLIBCXX23_DEPRECATED = denorm_present; >> + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss >> + _GLIBCXX23_DEPRECATED = false; >> +#pragma GCC diagnostic pop >> >> static _GLIBCXX_CONSTEXPR __float128 >> infinity() _GLIBCXX_USE_NOEXCEPT >> diff --git >> a/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc >> index 2c8712c861c..c36329b052d 100644 >> --- a/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc >> +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc >> @@ -1,5 +1,6 @@ >> // { dg-do run { target c++11 } } >> // { dg-require-cstdint "" } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // 2008-05-20 Paolo Carlini <[email protected]> >> // >> diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/char8_t.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/char8_t.cc >> index e23dbb7adbf..59a0bbbc160 100644 >> --- a/libstdc++-v3/testsuite/18_support/numeric_limits/char8_t.cc >> +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/char8_t.cc >> @@ -1,6 +1,7 @@ >> // { dg-do run { target c++11 } } >> // { dg-require-cstdint "" } >> // { dg-options "-fchar8_t" } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // Copyright (C) 2017-2026 Free Software Foundation, Inc. >> // >> diff --git >> a/libstdc++-v3/testsuite/18_support/numeric_limits/denorm_min.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/denorm_min.cc >> index b508d082b8e..619fe632c23 100644 >> --- a/libstdc++-v3/testsuite/18_support/numeric_limits/denorm_min.cc >> +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/denorm_min.cc >> @@ -1,4 +1,5 @@ >> // { dg-add-options ieee } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // 1999-08-23 bkoz >> >> diff --git >> a/libstdc++-v3/testsuite/18_support/numeric_limits/deprecated-2b.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/deprecated-2b.cc >> new file mode 100644 >> index 00000000000..5bc2fef977d >> --- /dev/null >> +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/deprecated-2b.cc >> @@ -0,0 +1,28 @@ >> +// Copyright (C) 2026 Free Software Foundation, Inc. >> +// >> +// This file is part of the GNU ISO C++ Library. This library is free >> +// software; you can redistribute it and/or modify it under the >> +// terms of the GNU General Public License as published by the >> +// Free Software Foundation; either version 3, or (at your option) >> +// any later version. >> +// >> +// This library is distributed in the hope that it will be useful, >> +// but WITHOUT ANY WARRANTY; without even the implied warranty of >> +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +// GNU General Public License for more details. >> +// >> +// You should have received a copy of the GNU General Public License >> along >> +// with this library; see the file COPYING3. If not see >> +// <http://www.gnu.org/licenses/>. >> + >> +// { dg-do compile { target c++23 } } >> + >> +#include <limits> >> + >> +std::float_denorm_style s; // { dg-warning "is deprecated" } >> +auto a = std::numeric_limits<float>::has_denorm; // { dg-warning "is >> deprecated" } >> +auto b = std::numeric_limits<float>::has_denorm_loss; // { dg-warning >> "is deprecated" } >> +auto c = std::numeric_limits<int>::has_denorm; // { dg-warning "is >> deprecated" } >> +auto d = std::numeric_limits<int>::has_denorm_loss; // { dg-warning "is >> deprecated" } >> + >> +// { dg-prune-output "declared here" } >> diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc >> index 88c0ca505f2..5d67b0152d5 100644 >> --- a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc >> +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc >> @@ -1,4 +1,5 @@ >> // { dg-do run { target c++11 } } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // 2010-02-17 Paolo Carlini <[email protected]> >> // >> diff --git >> a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc >> index 43985b5b734..7b2cc7b5b40 100644 >> --- >> a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc >> +++ >> b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc >> @@ -1,4 +1,5 @@ >> // { dg-do compile { target c++11 } } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // Copyright (C) 2010-2026 Free Software Foundation, Inc. >> // >> diff --git >> a/libstdc++-v3/testsuite/18_support/numeric_limits/specialization_default_values.cc >> b/libstdc++-v3/testsuite/18_support/numeric_limits/specialization_default_values.cc >> index 1bff0ad7f4d..896a2e485d7 100644 >> --- >> a/libstdc++-v3/testsuite/18_support/numeric_limits/specialization_default_values.cc >> +++ >> b/libstdc++-v3/testsuite/18_support/numeric_limits/specialization_default_values.cc >> @@ -1,4 +1,5 @@ >> // { dg-add-options ieee } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> // 1999-08-23 bkoz >> >> diff --git a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc >> b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc >> index af53718a95b..64436942033 100644 >> --- a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc >> +++ b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc >> @@ -17,6 +17,7 @@ >> >> // { dg-do run { target c++20 } } >> // { dg-timeout-factor 4 } >> +// { dg-additional-options "-Wno-deprecated-declarations" { target c++23 >> } } >> >> #include <limits> >> #include <ranges> >> -- >> 2.52.0 >> >>
