]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove redundant dependencies on _GLIBCXX_USE_C99_STDINT_TR1
authorJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 13:25:50 +0000 (14:25 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 16:47:09 +0000 (17:47 +0100)
We never need to use std::make_unsigned in std::char_traits<char16_t>
and std::char_traits<char32_t> because <cstdint> guarantees to provide
the types we need, since r9-2028-g8ba7f29e3dd064.

Similarly, experimental::source_location can just assume uint_least32_t
is defined by <cstdint>.

libstdc++-v3/ChangeLog:

* include/bits/char_traits.h (char_traits<char16_t>): Do not
depend on _GLIBCXX_USE_C99_STDINT_TR1.
(char_traits<char32_t>): Likewise.
* include/experimental/source_location: Likewise.

libstdc++-v3/include/bits/char_traits.h
libstdc++-v3/include/experimental/source_location

index 68ed827f9826f37d9392c875eb622171a96d7682..0928137854bb40ea9fa1928be60c7a8be62906f9 100644 (file)
@@ -762,10 +762,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef char16_t          char_type;
 #ifdef __UINT_LEAST16_TYPE__
       typedef __UINT_LEAST16_TYPE__        int_type;
-#elif defined _GLIBCXX_USE_C99_STDINT_TR1
-      typedef uint_least16_t    int_type;
 #else
-      typedef make_unsigned<char16_t>::type int_type;
+      typedef uint_least16_t    int_type;
 #endif
 #if _GLIBCXX_HOSTED
       typedef streamoff         off_type;
@@ -891,10 +889,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef char32_t          char_type;
 #ifdef __UINT_LEAST32_TYPE__
       typedef __UINT_LEAST32_TYPE__        int_type;
-#elif defined _GLIBCXX_USE_C99_STDINT_TR1
-      typedef uint_least32_t    int_type;
 #else
-      typedef make_unsigned<char32_t>::type int_type;
+      typedef uint_least32_t    int_type;
 #endif
 #if _GLIBCXX_HOSTED
       typedef streamoff         off_type;
index 1dfce7343c69ac451ee250033445b6bb91634a93..ee94a36cc43f1fabd7959b1cbc991a44256067be 100644 (file)
@@ -44,12 +44,6 @@ inline namespace fundamentals_v2 {
 
   struct source_location
   {
-#ifndef _GLIBCXX_USE_C99_STDINT_TR1
-  private:
-    using uint_least32_t = unsigned;
-  public:
-#endif
-
     // 14.1.2, source_location creation
     static constexpr source_location
     current(const char* __file = __builtin_FILE(),