[flang-commits] [flang] [llvm] [Flang] Introduce common::numeric_limits (PR #228108)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Tue Oct 6 03:27:56 PDT 2026
================
@@ -149,8 +149,7 @@ template <int PREC, int LOG10RADIX = 16> class BigRadixFloatingPointNumber {
// Sets *this to an unsigned integer value.
// Returns any remainder.
template <typename UINT> RT_API_ATTRS UINT SetTo(UINT n) {
- static_assert(
- std::is_same_v<UINT, common::uint128_t> || std::is_unsigned_v<UINT>);
+ static_assert(!common::numeric_limits<UINT>::is_signed);
----------------
eugeneepshteyn wrote:
nit: this is weaker than the check it replaces. `std::numeric_limits`'s primary template has `is_signed == false`, so any type without a specialization now passes: enums and classes, and `__float128` where libstdc++ doesn't specialize it (`static_assert(!Fortran::common::numeric_limits<__float128>::is_signed);` compiles with `g++ -std=c++17` 13.3). Requiring `is_integer` as well restores the old precondition; no current caller is affected.
https://github.com/llvm/llvm-project/pull/228108
More information about the flang-commits
mailing list