diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -59,7 +59,7 @@ includes are removed based on the language version used. Incidental transitive inclusions of the following headers have been removed: - - C++2b: ``bit``, ``cstring``, ``type_traits`` + - C++2b: ``atomic``, ``bit``, ``cstring``, ``type_traits`` - The headers ```` and ```` have been removed, since all the contents have been implemented in namespace ``std`` for at least two releases. diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -39,7 +39,7 @@ #include #include #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) -# include +# include <__atomic/memory_order.h> #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -534,29 +534,24 @@ #include <__atomic/kill_dependency.h> #include <__atomic/memory_order.h> #include <__config> -#include -#include -#include #include -#ifndef _LIBCPP_HAS_NO_THREADS -# include <__threading_support> -#endif - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif #ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER -# error is not implemented +# error is not implemented #endif + #ifdef kill_dependency -# error is incompatible with before C++23. Please compile with -std=c++23. +# error is incompatible with before C++23. Please compile with -std=c++23. #endif #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include +# include # include #endif diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -46,13 +46,18 @@ */ #include <__assert> // all public C++ headers provide the assertion handler +#include <__atomic/atomic_base.h> +#include <__atomic/memory_order.h> #include <__availability> #include <__config> #include <__memory/unique_ptr.h> +#include <__thread/poll_with_backoff.h> #include <__thread/timed_backoff_policy.h> #include <__utility/move.h> -#include +#include +#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -329,6 +334,7 @@ _LIBCPP_POP_MACROS #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include # include diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -269,6 +269,7 @@ #endif // !_LIBCPP_HAS_NO_THREADS #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include #endif diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -554,6 +554,7 @@ #endif #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include # include diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -229,7 +229,7 @@ #include #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) -#include // for __xindex_ +# include <__atomic/atomic.h> // for __xindex_ #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -1039,6 +1039,7 @@ _LIBCPP_END_NAMESPACE_STD #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include # include diff --git a/libcxx/include/latch b/libcxx/include/latch --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -41,9 +41,12 @@ */ #include <__assert> // all public C++ headers provide the assertion handler +#include <__atomic/atomic_base.h> +#include <__atomic/atomic_sync.h> +#include <__atomic/memory_order.h> #include <__availability> #include <__config> -#include +#include #include #include @@ -111,4 +114,8 @@ _LIBCPP_POP_MACROS +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include +#endif + #endif //_LIBCPP_LATCH diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -917,6 +917,7 @@ #endif #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include # include diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -631,7 +631,10 @@ export * module __atomic { - module aliases { private header "__atomic/aliases.h" } + module aliases { + private header "__atomic/aliases.h" + export atomic + } module atomic { private header "__atomic/atomic.h" } module atomic_base { private header "__atomic/atomic_base.h" } module atomic_flag { private header "__atomic/atomic_flag.h" } diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -704,7 +704,9 @@ _LIBCPP_POP_MACROS #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include +# include # include # include #endif diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -1189,6 +1189,7 @@ _LIBCPP_END_NAMESPACE_STD #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include # include # include # include diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore --- a/libcxx/include/semaphore +++ b/libcxx/include/semaphore @@ -46,12 +46,14 @@ */ #include <__assert> // all public C++ headers provide the assertion handler +#include <__atomic/atomic_base.h> +#include <__atomic/atomic_sync.h> +#include <__atomic/memory_order.h> #include <__availability> #include <__chrono/time_point.h> #include <__config> #include <__thread/timed_backoff_policy.h> #include <__threading_support> -#include #include #include @@ -188,4 +190,8 @@ _LIBCPP_POP_MACROS +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include +#endif + #endif //_LIBCPP_SEMAPHORE diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv --- a/libcxx/test/libcxx/transitive_includes/cxx03.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv @@ -74,6 +74,7 @@ barrier stdexcept barrier type_traits barrier variant +barrier version bit cstdint bit cstdlib bit iosfwd @@ -162,6 +163,7 @@ condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -453,7 +455,14 @@ iterator variant iterator version latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio +latch type_traits latch version limits type_traits limits version @@ -546,6 +555,7 @@ mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex functional mutex initializer_list mutex iosfwd @@ -696,6 +706,8 @@ scoped_allocator version semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv --- a/libcxx/test/libcxx/transitive_includes/cxx11.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv @@ -74,6 +74,7 @@ barrier stdexcept barrier type_traits barrier variant +barrier version bit cstdint bit cstdlib bit iosfwd @@ -162,6 +163,7 @@ condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -453,7 +455,14 @@ iterator variant iterator version latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio +latch type_traits latch version limits type_traits limits version @@ -546,6 +555,7 @@ mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex functional mutex initializer_list mutex iosfwd @@ -697,6 +707,8 @@ scoped_allocator version semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv --- a/libcxx/test/libcxx/transitive_includes/cxx14.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv @@ -74,6 +74,7 @@ barrier stdexcept barrier type_traits barrier variant +barrier version bit cstdint bit cstdlib bit iosfwd @@ -162,6 +163,7 @@ condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -455,7 +457,14 @@ iterator variant iterator version latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio +latch type_traits latch version limits type_traits limits version @@ -548,6 +557,7 @@ mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex functional mutex initializer_list mutex iosfwd @@ -699,6 +709,8 @@ scoped_allocator version semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv --- a/libcxx/test/libcxx/transitive_includes/cxx17.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv @@ -74,6 +74,7 @@ barrier stdexcept barrier type_traits barrier variant +barrier version bit cstdint bit cstdlib bit iosfwd @@ -162,6 +163,7 @@ condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -455,7 +457,14 @@ iterator variant iterator version latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio +latch type_traits latch version limits type_traits limits version @@ -548,6 +557,7 @@ mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex functional mutex initializer_list mutex iosfwd @@ -699,6 +709,8 @@ scoped_allocator version semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv --- a/libcxx/test/libcxx/transitive_includes/cxx20.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv @@ -72,6 +72,7 @@ barrier stdexcept barrier type_traits barrier variant +barrier version bit cstdint bit cstdlib bit iosfwd @@ -169,6 +170,7 @@ condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -461,7 +463,14 @@ iterator variant iterator version latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio +latch type_traits latch version limits type_traits limits version @@ -554,6 +563,7 @@ mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex functional mutex initializer_list mutex iosfwd @@ -705,6 +715,8 @@ scoped_allocator version semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv --- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv @@ -36,7 +36,6 @@ atomic limits atomic ratio atomic version -barrier atomic barrier cstddef barrier cstdint barrier cstring @@ -45,6 +44,7 @@ barrier limits barrier new barrier ratio +barrier version bit cstdint bit cstdlib bit limits @@ -115,11 +115,11 @@ complex version concepts cstddef concepts version -condition_variable atomic condition_variable cstddef condition_variable cstdint condition_variable cstdlib condition_variable cstring +condition_variable ctime condition_variable initializer_list condition_variable iosfwd condition_variable limits @@ -128,7 +128,6 @@ condition_variable stdexcept condition_variable system_error condition_variable typeinfo -condition_variable version coroutine compare coroutine cstddef coroutine cstdint @@ -287,7 +286,6 @@ fstream typeinfo fstream version functional array -functional atomic functional cstddef functional cstdint functional cstdlib @@ -317,7 +315,6 @@ initializer_list cstddef iomanip istream iomanip version -ios atomic ios cctype ios cstddef ios cstdint @@ -346,8 +343,13 @@ iterator limits iterator variant iterator version -latch atomic +latch cstddef +latch cstdint +latch cstring +latch ctime +latch iosfwd latch limits +latch ratio latch version limits version list compare @@ -389,7 +391,6 @@ map tuple map type_traits map version -memory atomic memory compare memory cstddef memory cstdint @@ -411,11 +412,11 @@ memory_resource stdexcept memory_resource tuple memory_resource version -mutex atomic mutex cstddef mutex cstdint mutex cstdlib mutex cstring +mutex ctime mutex initializer_list mutex iosfwd mutex limits @@ -445,7 +446,6 @@ optional stdexcept optional type_traits optional version -ostream atomic ostream bitset ostream cstddef ostream cstdint @@ -518,8 +518,9 @@ scoped_allocator new scoped_allocator tuple scoped_allocator version -semaphore atomic semaphore cstddef +semaphore cstdint +semaphore cstring semaphore ctime semaphore iosfwd semaphore limits diff --git a/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp b/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp --- a/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp +++ b/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp --- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp @@ -84,8 +84,9 @@ // }; #include -#include #include +#include +#include #include diff --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt --- a/libcxx/utils/data/ignore_format.txt +++ b/libcxx/utils/data/ignore_format.txt @@ -212,7 +212,6 @@ libcxx/include/__algorithm/upper_bound.h libcxx/include/any libcxx/include/array -libcxx/include/atomic libcxx/include/__atomic/atomic_base.h libcxx/include/__atomic/atomic_flag.h libcxx/include/__atomic/atomic.h