GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

Deprecates numeric_limits::has_denorm for C++23.

Deprecates `numeric_limits::has_denorm` and related features in libstdc++ for C++23, following the P2614R2 paper.

The C++ standard is evolving, and some features are being deprecated. This commit marks float_denorm_style, its enumerators, and numeric_limits::has_denorm and numeric_limits::has_denorm_loss as deprecated in libstdc++ for C++23. This change aligns with the approved paper P2614R2. The commit adds dg-warning directives to test files to ensure that deprecation warnings are generated as expected.

In Details

numeric_limits is a template class that provides information about the properties of arithmetic types, such as the minimum and maximum representable values, precision, and whether the type supports denormalized values. float_denorm_style is an enumeration that indicates how denormalized floating-point values are handled. Deprecating has_denorm and has_denorm_loss means that these members should no longer be used in new code, as they may be removed in a future version of the standard. This is part of a larger effort to modernize the C++ standard library.

For Context

In floating-point arithmetic, denormalized numbers (also called subnormal numbers) are used to represent values closer to zero than the smallest normal floating-point number. This allows for a more gradual loss of precision as numbers approach zero. The C++ standard library provides the numeric_limits class to query properties of numeric types. This commit deprecates the has_denorm member of numeric_limits, indicating whether a floating-point type supports denormalized values. This change is part of ongoing evolution of the C++ language.

Filed Under: libstdc++deprecationc++23numeric_limits