summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-05-19 12:54:41 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-05-19 23:39:20 +0100
commitf3e22baec0290c23654e99bf184153765944f4aa (patch)
tree56b2b15dc39cf95e0cc107c98008a2878c135cdf /libstdc++-v3
parentlibstdc++: Ensure pmr aliases work without <memory_resource> (diff)
downloadgcc-f3e22baec0290c23654e99bf184153765944f4aa.tar.gz
gcc-f3e22baec0290c23654e99bf184153765944f4aa.tar.bz2
gcc-f3e22baec0290c23654e99bf184153765944f4aa.tar.xz
libstdc++: Only include <ext/atomicity.h> for COW string
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.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/include/bits/basic_string.h1
-rw-r--r--libstdc++-v3/include/bits/cow_string.h2
2 files changed, 2 insertions, 1 deletions
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 @@
36 36
37#pragma GCC system_header 37#pragma GCC system_header
38 38
39#include <ext/atomicity.h>
40#include <ext/alloc_traits.h> 39#include <ext/alloc_traits.h>
41#include <debug/debug.h> 40#include <debug/debug.h>
42 41
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 @@
34 34
35#if ! _GLIBCXX_USE_CXX11_ABI 35#if ! _GLIBCXX_USE_CXX11_ABI
36 36
37#include <ext/atomicity.h> // _Atomic_word, __is_single_threaded
38
37#ifdef __cpp_lib_is_constant_evaluated 39#ifdef __cpp_lib_is_constant_evaluated
38// Support P1032R1 in C++20 (but not P0980R1 for COW strings). 40// Support P1032R1 in C++20 (but not P0980R1 for COW strings).
39# define __cpp_lib_constexpr_string 201811L 41# define __cpp_lib_constexpr_string 201811L