]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Only include <ext/atomicity.h> for COW string
authorJonathan Wakely <jwakely@redhat.com>
Thu, 19 May 2022 11:54:41 +0000 (12:54 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 19 May 2022 22:39:20 +0000 (23:39 +0100)
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
libstdc++-v3/include/bits/cow_string.h

index c3fbc53953cb948104947354518fc4a0a651f504..6041d05815bbdda820f10b901ce19186b31ffb16 100644 (file)
@@ -36,7 +36,6 @@
 
 #pragma GCC system_header
 
-#include <ext/atomicity.h>
 #include <ext/alloc_traits.h>
 #include <debug/debug.h>
 
index a49a5b04f2f242a132e58ef093010c0af2ce59ac..7bceb06a79b4c99a47da8295faea3365cecb9d3d 100644 (file)
@@ -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