From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8A63539AF4E3; Fri, 16 Jul 2021 14:36:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A63539AF4E3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-2360] libstdc++: Simplify numeric_limits<__max_size_type> X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 95891ca020591196cde50c4cde4cab14783a3c00 X-Git-Newrev: bfb0586ebdb696efa9e59cb8da1d977c5880653b Message-Id: <20210716143643.8A63539AF4E3@sourceware.org> Date: Fri, 16 Jul 2021 14:36:43 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2021 14:36:43 -0000 https://gcc.gnu.org/g:bfb0586ebdb696efa9e59cb8da1d977c5880653b commit r12-2360-gbfb0586ebdb696efa9e59cb8da1d977c5880653b Author: Jonathan Wakely Date: Fri Jul 16 13:53:05 2021 +0100 libstdc++: Simplify numeric_limits<__max_size_type> If __int128 is supported then __int_traits<__int128> is guaranteed to be specialized, so we can remove the preprocessor condition inside the std::numeric_traits<__detail::__max_size_type> specialization. Simply using __int_traits<_Sp::__rep> gives the right answer. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/max_size_type.h (numeric_limits<__max_size_type>): Use __int_traits unconditionally. Diff: --- libstdc++-v3/include/bits/max_size_type.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libstdc++-v3/include/bits/max_size_type.h b/libstdc++-v3/include/bits/max_size_type.h index 298a929db03..11721b30b61 100644 --- a/libstdc++-v3/include/bits/max_size_type.h +++ b/libstdc++-v3/include/bits/max_size_type.h @@ -771,14 +771,8 @@ namespace ranges static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; -#if __SIZEOF_INT128__ - static_assert(__extension__ same_as<_Sp::__rep, __uint128_t>); - static constexpr int digits = 129; -#else - static_assert(same_as<_Sp::__rep, unsigned long long>); static constexpr int digits - = __gnu_cxx::__int_traits::__digits + 1; -#endif + = __gnu_cxx::__int_traits<_Sp::__rep>::__digits + 1; static constexpr int digits10 = static_cast(digits * numbers::ln2 / numbers::ln10);