From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Remove redundant dependencies on _GLIBCXX_USE_C99_STDINT_TR1
Date: Fri, 12 May 2023 17:48:49 +0100 [thread overview]
Message-ID: <20230512164849.1303313-1-jwakely@redhat.com> (raw)
Tested powerpc64le-linux. Pushed to trunk.
-- >8 --
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 | 8 ++------
libstdc++-v3/include/experimental/source_location | 6 ------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index 68ed827f982..0928137854b 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -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;
diff --git a/libstdc++-v3/include/experimental/source_location b/libstdc++-v3/include/experimental/source_location
index 1dfce7343c6..ee94a36cc43 100644
--- a/libstdc++-v3/include/experimental/source_location
+++ b/libstdc++-v3/include/experimental/source_location
@@ -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(),
--
2.40.1
reply other threads:[~2023-05-12 16:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230512164849.1303313-1-jwakely@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).