aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-07-16 13:53:05 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-07-16 15:03:03 +0100
commitbfb0586ebdb696efa9e59cb8da1d977c5880653b (patch)
tree5a07e977dd388d3b54b7855c617d4bc506632648
parent95891ca020591196cde50c4cde4cab14783a3c00 (diff)
downloadgcc-bfb0586ebdb696efa9e59cb8da1d977c5880653b.zip
gcc-bfb0586ebdb696efa9e59cb8da1d977c5880653b.tar.gz
gcc-bfb0586ebdb696efa9e59cb8da1d977c5880653b.tar.bz2
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 <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/bits/max_size_type.h (numeric_limits<__max_size_type>): Use __int_traits unconditionally.
-rw-r--r--libstdc++-v3/include/bits/max_size_type.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/libstdc++-v3/include/bits/max_size_type.h b/libstdc++-v3/include/bits/max_size_type.h
index 298a929..11721b3 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<unsigned long long>::__digits + 1;
-#endif
+ = __gnu_cxx::__int_traits<_Sp::__rep>::__digits + 1;
static constexpr int digits10
= static_cast<int>(digits * numbers::ln2 / numbers::ln10);