public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Only include <ext/atomicity.h> for COW string
Date: Thu, 19 May 2022 23:43:06 +0100	[thread overview]
Message-ID: <20220519224306.702993-1-jwakely@redhat.com> (raw)

Tested powerpc64le-linux, pushed to trunk.

-- >8 --

Since the COW std::string was moved to its own header, we don't need the
atomic dispatch helpers in the definition of std::__cxx11::string. Move
the inclusion of the <ext/atomicity.h> header to <bits/cow_string.h>
where it's needed.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h: Do not include <ext/atomicity.h>
	here.
	* include/bits/cow_string.h: Include it here.
---
 libstdc++-v3/include/bits/basic_string.h | 1 -
 libstdc++-v3/include/bits/cow_string.h   | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index c3fbc53953c..6041d05815b 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -36,7 +36,6 @@
 
 #pragma GCC system_header
 
-#include <ext/atomicity.h>
 #include <ext/alloc_traits.h>
 #include <debug/debug.h>
 
diff --git a/libstdc++-v3/include/bits/cow_string.h b/libstdc++-v3/include/bits/cow_string.h
index a49a5b04f2f..7bceb06a79b 100644
--- a/libstdc++-v3/include/bits/cow_string.h
+++ b/libstdc++-v3/include/bits/cow_string.h
@@ -34,6 +34,8 @@
 
 #if ! _GLIBCXX_USE_CXX11_ABI
 
+#include <ext/atomicity.h> // _Atomic_word, __is_single_threaded
+
 #ifdef __cpp_lib_is_constant_evaluated
 // Support P1032R1 in C++20 (but not P0980R1 for COW strings).
 # define __cpp_lib_constexpr_string 201811L
-- 
2.34.3


                 reply	other threads:[~2022-05-19 22:43 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=20220519224306.702993-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).