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.
This commit is contained in:
Jonathan Wakely 2022-05-19 12:54:41 +01:00
parent 8ccdc7ce33
commit f3e22baec0
2 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <ext/atomicity.h>
#include <ext/alloc_traits.h> #include <ext/alloc_traits.h>
#include <debug/debug.h> #include <debug/debug.h>

View File

@ -34,6 +34,8 @@
#if ! _GLIBCXX_USE_CXX11_ABI #if ! _GLIBCXX_USE_CXX11_ABI
#include <ext/atomicity.h> // _Atomic_word, __is_single_threaded
#ifdef __cpp_lib_is_constant_evaluated #ifdef __cpp_lib_is_constant_evaluated
// Support P1032R1 in C++20 (but not P0980R1 for COW strings). // Support P1032R1 in C++20 (but not P0980R1 for COW strings).
# define __cpp_lib_constexpr_string 201811L # define __cpp_lib_constexpr_string 201811L