[libc++] Granularize the rest of memory
authorNikolas Klauser <nikolasklauser@berlin.de>
Sun, 4 Sep 2022 22:01:15 +0000 (00:01 +0200)
committerNikolas Klauser <nikolasklauser@berlin.de>
Mon, 5 Sep 2022 10:36:41 +0000 (12:36 +0200)
Reviewed By: ldionne, #libc

Spies: vitalybuka, paulkirth, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D132790

181 files changed:
libcxx/include/CMakeLists.txt
libcxx/include/__algorithm/inplace_merge.h
libcxx/include/__algorithm/ranges_copy.h
libcxx/include/__algorithm/ranges_equal_range.h
libcxx/include/__algorithm/ranges_find_end.h
libcxx/include/__algorithm/ranges_minmax.h
libcxx/include/__algorithm/ranges_next_permutation.h
libcxx/include/__algorithm/ranges_partial_sort.h
libcxx/include/__algorithm/ranges_partial_sort_copy.h
libcxx/include/__algorithm/ranges_partition.h
libcxx/include/__algorithm/ranges_prev_permutation.h
libcxx/include/__algorithm/ranges_search.h
libcxx/include/__algorithm/ranges_search_n.h
libcxx/include/__algorithm/ranges_set_difference.h
libcxx/include/__algorithm/ranges_unique.h
libcxx/include/__algorithm/ranges_unique_copy.h
libcxx/include/__algorithm/set_symmetric_difference.h
libcxx/include/__algorithm/set_union.h
libcxx/include/__algorithm/sort.h
libcxx/include/__algorithm/stable_partition.h
libcxx/include/__algorithm/stable_sort.h
libcxx/include/__bsd_locale_fallbacks.h
libcxx/include/__filesystem/filesystem_error.h
libcxx/include/__format/format_arg_store.h
libcxx/include/__format/formatter_integral.h
libcxx/include/__functional/function.h
libcxx/include/__hash_table
libcxx/include/__locale
libcxx/include/__memory/align.h [new file with mode: 0644]
libcxx/include/__memory/builtin_new_allocator.h [new file with mode: 0644]
libcxx/include/__memory/construct_at.h
libcxx/include/__memory/destruct_n.h [new file with mode: 0644]
libcxx/include/__memory/ranges_construct_at.h
libcxx/include/__memory/ranges_uninitialized_algorithms.h
libcxx/include/__memory/raw_storage_iterator.h
libcxx/include/__memory/shared_ptr.h
libcxx/include/__memory/temp_value.h [new file with mode: 0644]
libcxx/include/__memory/uninitialized_algorithms.h
libcxx/include/__node_handle
libcxx/include/__split_buffer
libcxx/include/__tree
libcxx/include/__type_traits/is_allocator.h [new file with mode: 0644]
libcxx/include/__type_traits/noexcept_move_assign_container.h [new file with mode: 0644]
libcxx/include/__utility/forward_like.h
libcxx/include/algorithm
libcxx/include/any
libcxx/include/barrier
libcxx/include/condition_variable
libcxx/include/deque
libcxx/include/experimental/coroutine
libcxx/include/experimental/memory_resource
libcxx/include/forward_list
libcxx/include/fstream
libcxx/include/functional
libcxx/include/future
libcxx/include/list
libcxx/include/locale
libcxx/include/map
libcxx/include/memory
libcxx/include/module.modulemap.in
libcxx/include/mutex
libcxx/include/ostream
libcxx/include/queue
libcxx/include/regex
libcxx/include/scoped_allocator
libcxx/include/set
libcxx/include/string
libcxx/include/thread
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/include/vector
libcxx/test/libcxx/memory/compressed_pair/compressed_pair.pass.cpp
libcxx/test/libcxx/private_headers.verify.cpp
libcxx/test/libcxx/transitive_includes.sh.cpp
libcxx/test/libcxx/transitive_includes/cxx2b/expected.algorithm
libcxx/test/libcxx/transitive_includes/cxx2b/expected.any
libcxx/test/libcxx/transitive_includes/cxx2b/expected.barrier
libcxx/test/libcxx/transitive_includes/cxx2b/expected.bitset
libcxx/test/libcxx/transitive_includes/cxx2b/expected.ccomplex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.codecvt
libcxx/test/libcxx/transitive_includes/cxx2b/expected.complex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.condition_variable
libcxx/test/libcxx/transitive_includes/cxx2b/expected.ctgmath
libcxx/test/libcxx/transitive_includes/cxx2b/expected.deque
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_algorithm
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_coroutine
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_deque
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_forward_list
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_list
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_map
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_memory_resource
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_regex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_set
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_string
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_unordered_map
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_unordered_set
libcxx/test/libcxx/transitive_includes/cxx2b/expected.experimental_vector
libcxx/test/libcxx/transitive_includes/cxx2b/expected.filesystem
libcxx/test/libcxx/transitive_includes/cxx2b/expected.format
libcxx/test/libcxx/transitive_includes/cxx2b/expected.forward_list
libcxx/test/libcxx/transitive_includes/cxx2b/expected.fstream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.future
libcxx/test/libcxx/transitive_includes/cxx2b/expected.iomanip
libcxx/test/libcxx/transitive_includes/cxx2b/expected.ios
libcxx/test/libcxx/transitive_includes/cxx2b/expected.iostream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.istream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.list
libcxx/test/libcxx/transitive_includes/cxx2b/expected.locale
libcxx/test/libcxx/transitive_includes/cxx2b/expected.map
libcxx/test/libcxx/transitive_includes/cxx2b/expected.mutex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.ostream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.queue
libcxx/test/libcxx/transitive_includes/cxx2b/expected.random
libcxx/test/libcxx/transitive_includes/cxx2b/expected.regex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.scoped_allocator
libcxx/test/libcxx/transitive_includes/cxx2b/expected.set
libcxx/test/libcxx/transitive_includes/cxx2b/expected.shared_mutex
libcxx/test/libcxx/transitive_includes/cxx2b/expected.sstream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.stack
libcxx/test/libcxx/transitive_includes/cxx2b/expected.streambuf
libcxx/test/libcxx/transitive_includes/cxx2b/expected.string
libcxx/test/libcxx/transitive_includes/cxx2b/expected.strstream
libcxx/test/libcxx/transitive_includes/cxx2b/expected.system_error
libcxx/test/libcxx/transitive_includes/cxx2b/expected.thread
libcxx/test/libcxx/transitive_includes/cxx2b/expected.unordered_map
libcxx/test/libcxx/transitive_includes/cxx2b/expected.unordered_set
libcxx/test/libcxx/transitive_includes/cxx2b/expected.vector
libcxx/test/libcxx/utilities/any/allocator.pass.cpp
libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp
libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp
libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp
libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp
libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp
libcxx/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp
libcxx/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp
libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
libcxx/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp
libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp
libcxx/test/std/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp
libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp
libcxx/test/std/utilities/memory/ptr.align/align.pass.cpp
libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp
libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp
libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp
libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_copy_move.fail.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp
libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp
libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.runtime.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
libcxx/test/support/allocators.h
libcxx/test/support/container_test_types.h
libcxx/test/support/controlled_allocators.h
libcxx/test/support/min_allocator.h
libcxxabi/src/cxa_guard_impl.h
libcxxabi/src/demangle/ItaniumDemangle.h

index ee2f3b7..e72b42c 100644 (file)
@@ -379,6 +379,7 @@ set(files
   __locale
   __mbstate_t.h
   __memory/addressof.h
+  __memory/align.h
   __memory/allocate_at_least.h
   __memory/allocation_guard.h
   __memory/allocator.h
@@ -386,15 +387,18 @@ set(files
   __memory/allocator_traits.h
   __memory/assume_aligned.h
   __memory/auto_ptr.h
+  __memory/builtin_new_allocator.h
   __memory/compressed_pair.h
   __memory/concepts.h
   __memory/construct_at.h
+  __memory/destruct_n.h
   __memory/pointer_traits.h
   __memory/ranges_construct_at.h
   __memory/ranges_uninitialized_algorithms.h
   __memory/raw_storage_iterator.h
   __memory/shared_ptr.h
   __memory/swap_allocator.h
+  __memory/temp_value.h
   __memory/temporary_buffer.h
   __memory/uninitialized_algorithms.h
   __memory/unique_ptr.h
@@ -537,6 +541,7 @@ set(files
   __type_traits/integral_constant.h
   __type_traits/is_abstract.h
   __type_traits/is_aggregate.h
+  __type_traits/is_allocator.h
   __type_traits/is_arithmetic.h
   __type_traits/is_array.h
   __type_traits/is_assignable.h
@@ -619,6 +624,7 @@ set(files
   __type_traits/maybe_const.h
   __type_traits/nat.h
   __type_traits/negation.h
+  __type_traits/noexcept_move_assign_container.h
   __type_traits/promote.h
   __type_traits/rank.h
   __type_traits/remove_all_extents.h
index 01a871a..dc5108a 100644 (file)
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/reverse_iterator.h>
-#include <memory>
+#include <__memory/destruct_n.h>
+#include <__memory/temporary_buffer.h>
+#include <__memory/unique_ptr.h>
+#include <__utility/pair.h>
+#include <new>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 0d85310..87a6a1e 100644 (file)
@@ -18,6 +18,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index beeba18..efe5b2f 100644 (file)
@@ -24,6 +24,7 @@
 #include <__ranges/subrange.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index d9be148..df89100 100644 (file)
@@ -21,6 +21,7 @@
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>
 #include <__ranges/subrange.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 11471be..377fe9b 100644 (file)
@@ -23,6 +23,7 @@
 #include <__ranges/concepts.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 #include <initializer_list>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 5c9e75a..6c8e8e1 100644 (file)
@@ -22,6 +22,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index b427e6b..3ea0a7f 100644 (file)
@@ -27,6 +27,7 @@
 #include <__ranges/dangling.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 9ad8980..212db55 100644 (file)
@@ -24,6 +24,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 0d55210..eaa696d 100644 (file)
@@ -26,6 +26,7 @@
 #include <__ranges/subrange.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 133bc6a..6866d90 100644 (file)
@@ -22,6 +22,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 4ac43fa..24bbe28 100644 (file)
@@ -22,6 +22,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/size.h>
 #include <__ranges/subrange.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index ce06729..d2846f6 100644 (file)
@@ -25,6 +25,7 @@
 #include <__ranges/size.h>
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 8b97202..398ccc9 100644 (file)
@@ -23,6 +23,7 @@
 #include <__ranges/dangling.h>
 #include <__type_traits/decay.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 9637346..45e5427 100644 (file)
@@ -26,6 +26,7 @@
 #include <__ranges/subrange.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index f7b2293..3ad47b0 100644 (file)
@@ -27,6 +27,7 @@
 #include <__ranges/dangling.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 31e2e87..3dd093c 100644 (file)
@@ -15,6 +15,7 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 76cd30b..ce15623 100644 (file)
@@ -15,6 +15,7 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index a7d9002..4ff3379 100644 (file)
@@ -22,8 +22,9 @@
 #include <__functional/operations.h>
 #include <__functional/ranges_operations.h>
 #include <__iterator/iterator_traits.h>
+#include <__memory/destruct_n.h>
+#include <__memory/unique_ptr.h>
 #include <climits>
-#include <memory>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index a5c7e86..b85acc7 100644 (file)
 #include <__iterator/advance.h>
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
-#include <memory>
+#include <__memory/destruct_n.h>
+#include <__memory/temporary_buffer.h>
+#include <__memory/unique_ptr.h>
+#include <__utility/pair.h>
+#include <new>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index dfd428f..1b8aafb 100644 (file)
 #include <__algorithm/sort.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
+#include <__memory/destruct_n.h>
+#include <__memory/temporary_buffer.h>
+#include <__memory/unique_ptr.h>
 #include <__utility/move.h>
-#include <memory>
+#include <__utility/pair.h>
+#include <new>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 3d5b785..9abd7e7 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef _LIBCPP___BSD_LOCALE_FALLBACKS_H
 #define _LIBCPP___BSD_LOCALE_FALLBACKS_H
 
-#include <memory>
 #include <stdarg.h>
 #include <stdlib.h>
 
index e32b14c..eb5c38a 100644 (file)
@@ -14,6 +14,7 @@
 #include <__config>
 #include <__filesystem/path.h>
 #include <__memory/shared_ptr.h>
+#include <__utility/forward.h>
 #include <iosfwd>
 #include <new>
 #include <system_error>
index 26a5e71..1820c03 100644 (file)
@@ -19,6 +19,7 @@
 #include <__config>
 #include <__format/concepts.h>
 #include <__format/format_arg.h>
+#include <__utility/forward.h>
 #include <cstring>
 #include <string>
 #include <string_view>
index d23b398..87c6d55 100644 (file)
@@ -18,6 +18,7 @@
 #include <__format/formatter_output.h>
 #include <__format/parser_std_format_spec.h>
 #include <__utility/unreachable.h>
+#include <array>
 #include <charconv>
 #include <limits>
 #include <string>
index bcecd3e..8a4a2cf 100644 (file)
 #include <__functional/unary_function.h>
 #include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
+#include <__memory/allocator.h>
 #include <__memory/allocator_traits.h>
+#include <__memory/builtin_new_allocator.h>
 #include <__memory/compressed_pair.h>
 #include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/piecewise_construct.h>
 #include <__utility/swap.h>
 #include <exception>
-#include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h>
+#include <new>
+#include <tuple>
 #include <type_traits>
+#include <typeinfo>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 51a8bf8..5a72ccf 100644 (file)
 #include <__debug>
 #include <__functional/hash.h>
 #include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
 #include <__memory/swap_allocator.h>
+#include <__memory/unique_ptr.h>
 #include <__type_traits/can_extract_key.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
 #include <__utility/swap.h>
 #include <cmath>
+#include <cstring>
 #include <initializer_list>
-#include <memory>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 0bf8344..65160f3 100644 (file)
 
 #include <__availability>
 #include <__config>
+#include <__memory/shared_ptr.h>
 #include <cctype>
 #include <cstdint>
 #include <locale.h>
-#include <memory>
 #include <mutex>
 #include <string>
 
diff --git a/libcxx/include/__memory/align.h b/libcxx/include/__memory/align.h
new file mode 100644 (file)
index 0000000..c679220
--- /dev/null
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ALIGN_H
+#define _LIBCPP___MEMORY_ALIGN_H
+
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_ALIGN_H
diff --git a/libcxx/include/__memory/builtin_new_allocator.h b/libcxx/include/__memory/builtin_new_allocator.h
new file mode 100644 (file)
index 0000000..cd1a866
--- /dev/null
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_BUILTIN_NEW_ALLOCATOR_H
+#define _LIBCPP___MEMORY_BUILTIN_NEW_ALLOCATOR_H
+
+#include <__config>
+#include <__memory/unique_ptr.h>
+#include <cstddef>
+#include <new>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// __builtin_new_allocator -- A non-templated helper for allocating and
+// deallocating memory using __builtin_operator_new and
+// __builtin_operator_delete. It should be used in preference to
+// `std::allocator<T>` to avoid additional instantiations.
+struct __builtin_new_allocator {
+  struct __builtin_new_deleter {
+    typedef void* pointer_type;
+
+    _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
+        : __size_(__size), __align_(__align) {}
+
+    void operator()(void* __p) const _NOEXCEPT {
+        _VSTD::__libcpp_deallocate(__p, __size_, __align_);
+    }
+
+   private:
+    size_t __size_;
+    size_t __align_;
+  };
+
+  typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
+
+  static __holder_t __allocate_bytes(size_t __s, size_t __align) {
+      return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
+                     __builtin_new_deleter(__s, __align));
+  }
+
+  static void __deallocate_bytes(void* __p, size_t __s,
+                                 size_t __align) _NOEXCEPT {
+      _VSTD::__libcpp_deallocate(__p, __s, __align);
+  }
+
+  template <class _Tp>
+  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
+  static __holder_t __allocate_type(size_t __n) {
+      return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+  }
+
+  template <class _Tp>
+  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
+  static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT {
+      __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+  }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_BUILTIN_NEW_ALLOCATOR_H
index 7093883..a11a6eb 100644 (file)
@@ -17,6 +17,7 @@
 #include <__memory/voidify.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <new>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__memory/destruct_n.h b/libcxx/include/__memory/destruct_n.h
new file mode 100644 (file)
index 0000000..2cfb2e4
--- /dev/null
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_DESTRUCT_N_H
+#define _LIBCPP___MEMORY_DESTRUCT_N_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct __destruct_n
+{
+private:
+    size_t __size_;
+
+    template <class _Tp>
+    _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
+        {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
+
+    template <class _Tp>
+    _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
+        {}
+
+    _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
+        {++__size_;}
+    _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
+        {}
+
+    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
+        {__size_ = __s;}
+    _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
+        {}
+public:
+    _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
+        : __size_(__s) {}
+
+    template <class _Tp>
+    _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
+        {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
+
+    template <class _Tp>
+    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
+        {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
+
+    template <class _Tp>
+    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
+        {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_DESTRUCT_N_H
index 3fee8a4..19cd0ff 100644 (file)
@@ -22,6 +22,7 @@
 #include <__utility/declval.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <new>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 57662a8..7d2ac3a 100644 (file)
@@ -24,6 +24,7 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
+#include <new>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 9b6594b..11971de 100644 (file)
@@ -16,6 +16,7 @@
 #include <__memory/addressof.h>
 #include <__utility/move.h>
 #include <cstddef>
+#include <new>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 53113c0..b350bcd 100644 (file)
@@ -34,6 +34,7 @@
 #include <cstddef>
 #include <cstdlib> // abort
 #include <iosfwd>
+#include <new>
 #include <stdexcept>
 #include <type_traits>
 #include <typeinfo>
diff --git a/libcxx/include/__memory/temp_value.h b/libcxx/include/__memory/temp_value.h
new file mode 100644 (file)
index 0000000..164688b
--- /dev/null
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_TEMP_VALUE_H
+#define _LIBCPP___MEMORY_TEMP_VALUE_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/allocator_traits.h>
+#include <__type_traits/aligned_storage.h>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Alloc>
+struct __temp_value {
+    typedef allocator_traits<_Alloc> _Traits;
+
+#ifdef _LIBCPP_CXX03_LANG
+    typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
+#else
+    union { _Tp __v; };
+#endif
+    _Alloc &__a;
+
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() {
+#ifdef _LIBCPP_CXX03_LANG
+        return reinterpret_cast<_Tp*>(std::addressof(__v));
+#else
+        return std::addressof(__v);
+#endif
+    }
+
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp &   get() { return *__addr(); }
+
+    template<class... _Args>
+    _LIBCPP_NO_CFI
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
+      _Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
+    }
+
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_TEMP_VALUE_H
index dc58fb3..6a7b708 100644 (file)
@@ -24,6 +24,7 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 #include <__utility/transaction.h>
+#include <new>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 71309be..8cb6d62 100644 (file)
@@ -60,7 +60,8 @@ public:
 
 #include <__assert>
 #include <__config>
-#include <memory>
+#include <__memory/allocator_traits.h>
+#include <__memory/pointer_traits.h>
 #include <optional>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index d58baa1..2ffa008 100644 (file)
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/move_iterator.h>
+#include <__memory/allocate_at_least.h>
 #include <__memory/allocator.h>
+#include <__memory/allocator_traits.h>
 #include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
 #include <__memory/swap_allocator.h>
 #include <__utility/forward.h>
-#include <memory>
+#include <__utility/move.h>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 867a856..b4e9569 100644 (file)
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/next.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
 #include <__memory/swap_allocator.h>
+#include <__memory/unique_ptr.h>
 #include <__type_traits/can_extract_key.h>
 #include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
 #include <__utility/swap.h>
 #include <limits>
-#include <memory>
 #include <stdexcept>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__type_traits/is_allocator.h b/libcxx/include/__type_traits/is_allocator.h
new file mode 100644 (file)
index 0000000..f4d70e9
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_IS_ALLOCATOR_H
+#define _LIBCPP___TYPE_IS_ALLOCATOR_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<typename _Alloc, typename = void, typename = void>
+struct __is_allocator : false_type {};
+
+template<typename _Alloc>
+struct __is_allocator<_Alloc,
+       typename __void_t<typename _Alloc::value_type>::type,
+       typename __void_t<decltype(declval<_Alloc&>().allocate(size_t(0)))>::type
+     >
+   : true_type {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_IS_ALLOCATOR_H
diff --git a/libcxx/include/__type_traits/noexcept_move_assign_container.h b/libcxx/include/__type_traits/noexcept_move_assign_container.h
new file mode 100644 (file)
index 0000000..f8edd76
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
+#define _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
+
+#include <__config>
+#include <__memory/allocator_traits.h>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
+struct __noexcept_move_assign_container : public integral_constant<bool,
+    _Traits::propagate_on_container_move_assignment::value
+#if _LIBCPP_STD_VER > 14
+        || _Traits::is_always_equal::value
+#else
+        && is_nothrow_move_assignable<_Alloc>::value
+#endif
+    > {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
index 7809769..1446964 100644 (file)
@@ -34,7 +34,7 @@ template <class _Ap, class _Bp>
 using _ForwardLike = _OverrideRef<_Ap&&, _CopyConst<remove_reference_t<_Ap>, remove_reference_t<_Bp>>>;
 
 template <class _Tp, class _Up>
-[[nodiscard]] constexpr auto forward_like(_Up&& __ux) noexcept -> _ForwardLike<_Tp, _Up> {
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto forward_like(_Up&& __ux) noexcept -> _ForwardLike<_Tp, _Up> {
   return static_cast<_ForwardLike<_Tp, _Up>>(__ux);
 }
 
index f036fd0..06d0a40 100644 (file)
@@ -1709,7 +1709,6 @@ template <class BidirectionalIterator, class Compare>
 #include <__debug>
 #include <cstddef>
 #include <cstring>
-#include <memory>
 #include <type_traits>
 #include <version>
 
@@ -1907,7 +1906,7 @@ template <class BidirectionalIterator, class Compare>
 #endif
 
 #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
-#   include <__pstl_algorithm>
+#  include <__pstl_algorithm>
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
@@ -1915,7 +1914,10 @@ template <class BidirectionalIterator, class Compare>
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <atomic>
 #  include <iterator>
+#  include <memory>
+#  include <stdexcept>
 #  include <utility>
 #endif
 
index ec12cfa..527af76 100644 (file)
@@ -83,13 +83,16 @@ namespace std {
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__availability>
 #include <__config>
+#include <__memory/allocator.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
 #include <__utility/forward.h>
 #include <__utility/in_place.h>
 #include <__utility/move.h>
 #include <__utility/unreachable.h>
 #include <cstdlib>
 #include <initializer_list>
-#include <memory>
 #include <type_traits>
 #include <typeinfo>
 #include <version>
@@ -695,4 +698,10 @@ _LIBCPP_END_NAMESPACE_STD
 #  include <chrono> // IGNORE-CYCLE due to <format>
 #endif
 
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <iterator>
+#  include <memory>
+#  include <variant>
+#endif
+
 #endif // _LIBCPP_ANY
index d5104b5..836a003 100644 (file)
@@ -48,10 +48,19 @@ namespace std
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__availability>
 #include <__config>
+#include <__memory/unique_ptr.h>
 #include <__thread/timed_backoff_policy.h>
+#include <__utility/move.h>
 #include <atomic>
 #include <limits>
-#include <memory>
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <concepts>
+#  include <iterator>
+#  include <memory>
+#  include <stdexcept>
+#  include <variant>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
index 92088f3..038f0ba 100644 (file)
@@ -108,8 +108,9 @@ public:
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
 #include <__mutex_base>
-#include <memory>
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
index 9a26f16..bce6bc2 100644 (file)
@@ -176,7 +176,11 @@ template <class T, class Allocator, class Predicate>
 #include <__iterator/next.h>
 #include <__iterator/prev.h>
 #include <__iterator/reverse_iterator.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/temp_value.h>
+#include <__memory/unique_ptr.h>
 #include <__split_buffer>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
index e32aedc..55062d4 100644 (file)
@@ -50,10 +50,28 @@ template <class P> struct hash<coroutine_handle<P>>;
 #include <__functional/operations.h>
 #include <cstddef>
 #include <experimental/__config>
-#include <memory> // for hash<T*>
 #include <new>
 #include <type_traits>
 
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <atomic>
+#  include <climits>
+#  include <cmath>
+#  include <compare>
+#  include <concepts>
+#  include <ctime>
+#  include <initializer_list>
+#  include <iosfwd>
+#  include <iterator>
+#  include <memory>
+#  include <ratio>
+#  include <stdexcept>
+#  include <tuple>
+#  include <typeinfo>
+#  include <utility>
+#  include <variant>
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
index 510e282..f6f01dc 100644 (file)
@@ -65,6 +65,7 @@ namespace pmr {
  */
 
 #include <__assert> // all public C++ headers provide the assertion handler
+#include <__memory/allocator_traits.h>
 #include <__tuple>
 #include <__utility/move.h>
 #include <cstddef>
@@ -72,11 +73,23 @@ namespace pmr {
 #include <experimental/__config>
 #include <experimental/__memory>
 #include <limits>
-#include <memory>
 #include <new>
 #include <stdexcept>
+#include <tuple>
 #include <type_traits>
 
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <atomic>
+#  include <climits>
+#  include <concepts>
+#  include <cstring>
+#  include <ctime>
+#  include <iterator>
+#  include <memory>
+#  include <ratio>
+#  include <variant>
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
index d5ea3ec..4087992 100644 (file)
@@ -188,10 +188,18 @@ template <class T, class Allocator, class Predicate>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/move_iterator.h>
 #include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__memory/allocator.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
 #include <__memory/swap_allocator.h>
+#include <__memory/unique_ptr.h>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
+#include <__utility/move.h>
 #include <limits>
-#include <memory>
 #include <type_traits>
 #include <version>
 
index a6bd4a8..95f345f 100644 (file)
@@ -192,6 +192,7 @@ typedef basic_fstream<wchar_t> wfstream;
 #include <cstring>
 #include <istream>
 #include <ostream>
+#include <typeinfo>
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
index 60f6514..ab2c62d 100644 (file)
@@ -533,7 +533,7 @@ POLICY:  For non-variadic implementations, the number of arguments is limited
 #include <__utility/forward.h>
 #include <concepts>
 #include <exception>
-#include <memory>
+#include <memory> // TODO: find out why removing this breaks the modules build
 #include <tuple>
 #include <type_traits>
 #include <typeinfo>
index 716daa7..1bc9a95 100644 (file)
@@ -372,8 +372,8 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <exception>
-#include <memory>
 #include <mutex>
+#include <new>
 #include <system_error>
 #include <thread>
 #include <version>
index a4e6def..e5a6c3f 100644 (file)
@@ -194,12 +194,20 @@ template <class T, class Allocator, class Predicate>
 #include <__iterator/next.h>
 #include <__iterator/prev.h>
 #include <__iterator/reverse_iterator.h>
+#include <__memory/addressof.h>
+#include <__memory/allocator.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
 #include <__memory/swap_allocator.h>
+#include <__memory/unique_ptr.h>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
+#include <cstring>
 #include <limits>
-#include <memory>
 #include <type_traits>
 #include <version>
 
index 3fe8f5d..fec6c2f 100644 (file)
@@ -201,13 +201,14 @@ template <class charT> class messages_byname;
 #include <__iterator/istreambuf_iterator.h>
 #include <__iterator/ostreambuf_iterator.h>
 #include <__locale>
+#include <__memory/unique_ptr.h>
 #include <cstdarg> // TODO: Remove this include
 #include <cstdio>
 #include <cstdlib>
 #include <ctime>
 #include <ios>
 #include <limits>
-#include <memory>
+#include <new>
 #include <streambuf>
 #include <version>
 
index 20e6126..6df74c3 100644 (file)
@@ -538,11 +538,14 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/reverse_iterator.h>
+#include <__memory/allocator.h>
 #include <__node_handle>
 #include <__tree>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
+#include <__utility/piecewise_construct.h>
 #include <__utility/swap.h>
-#include <memory>
+#include <tuple>
 #include <type_traits>
 #include <version>
 
index 9776de6..4d29b71 100644 (file)
@@ -860,11 +860,10 @@ template<size_t N, class T>
 
 */
 
-#include <__algorithm/copy.h>
-#include <__algorithm/move.h>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <__memory/addressof.h>
+#include <__memory/align.h>
 #include <__memory/allocate_at_least.h>
 #include <__memory/allocation_guard.h>
 #include <__memory/allocator.h>
@@ -884,15 +883,6 @@ template<size_t N, class T>
 #include <__memory/uninitialized_algorithms.h>
 #include <__memory/unique_ptr.h>
 #include <__memory/uses_allocator.h>
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
-#include <iosfwd>
-#include <new>
-#include <stdexcept>
-#include <tuple>
-#include <type_traits>
-#include <typeinfo>
 #include <version>
 
 // standard-mandated includes
@@ -902,153 +892,21 @@ template<size_t N, class T>
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-struct __destruct_n
-{
-private:
-    size_t __size_;
-
-    template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
-        {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
-
-    template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
-        {}
-
-    _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
-        {++__size_;}
-    _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
-        {}
-
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
-        {__size_ = __s;}
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
-        {}
-public:
-    _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
-        : __size_(__s) {}
-
-    template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
-        {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-
-    template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
-        {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-
-    template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
-        {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-};
-
-_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
-
-template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
-struct __noexcept_move_assign_container : public integral_constant<bool,
-    _Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER > 14
-        || _Traits::is_always_equal::value
-#else
-        && is_nothrow_move_assignable<_Alloc>::value
-#endif
-    > {};
-
-
-template <class _Tp, class _Alloc>
-struct __temp_value {
-    typedef allocator_traits<_Alloc> _Traits;
-
-#ifdef _LIBCPP_CXX03_LANG
-    typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
-#else
-    union { _Tp __v; };
-#endif
-    _Alloc &__a;
-
-    _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() {
-#ifdef _LIBCPP_CXX03_LANG
-        return reinterpret_cast<_Tp*>(std::addressof(__v));
-#else
-        return std::addressof(__v);
-#endif
-    }
-
-    _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp &   get() { return *__addr(); }
-
-    template<class... _Args>
-    _LIBCPP_NO_CFI
-    _LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
-      _Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
-    }
-
-    _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); }
-};
-
-template<typename _Alloc, typename = void, typename = void>
-struct __is_allocator : false_type {};
-
-template<typename _Alloc>
-struct __is_allocator<_Alloc,
-       typename __void_t<typename _Alloc::value_type>::type,
-       typename __void_t<decltype(declval<_Alloc&>().allocate(size_t(0)))>::type
-     >
-   : true_type {};
-
-// __builtin_new_allocator -- A non-templated helper for allocating and
-// deallocating memory using __builtin_operator_new and
-// __builtin_operator_delete. It should be used in preference to
-// `std::allocator<T>` to avoid additional instantiations.
-struct __builtin_new_allocator {
-  struct __builtin_new_deleter {
-    typedef void* pointer_type;
-
-    _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
-        : __size_(__size), __align_(__align) {}
-
-    void operator()(void* __p) const _NOEXCEPT {
-        _VSTD::__libcpp_deallocate(__p, __size_, __align_);
-    }
-
-   private:
-    size_t __size_;
-    size_t __align_;
-  };
-
-  typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
-
-  static __holder_t __allocate_bytes(size_t __s, size_t __align) {
-      return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
-                     __builtin_new_deleter(__s, __align));
-  }
-
-  static void __deallocate_bytes(void* __p, size_t __s,
-                                 size_t __align) _NOEXCEPT {
-      _VSTD::__libcpp_deallocate(__p, __s, __align);
-  }
-
-  template <class _Tp>
-  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
-  static __holder_t __allocate_type(size_t __n) {
-      return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
-  }
-
-  template <class _Tp>
-  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
-  static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT {
-      __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
-  }
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
 #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
 #   include <__pstl_memory>
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <cstddef>
+#  include <cstdint>
+#  include <cstring>
+#  include <iosfwd>
 #  include <iterator>
+#  include <new>
+#  include <stdexcept>
+#  include <tuple>
+#  include <type_traits>
+#  include <typeinfo>
 #  include <utility>
 #endif
 
index f0ec768..e9f8cdc 100644 (file)
@@ -834,6 +834,7 @@ module std [system] {
 
     module __memory {
       module addressof                       { private header "__memory/addressof.h" }
+      module align                           { private header "__memory/align.h" }
       module allocate_at_least               { private header "__memory/allocate_at_least.h" }
       module allocation_guard                { private header "__memory/allocation_guard.h" }
       module allocator                       { private header "__memory/allocator.h" }
@@ -841,15 +842,18 @@ module std [system] {
       module allocator_traits                { private header "__memory/allocator_traits.h" }
       module assume_aligned                  { private header "__memory/assume_aligned.h" }
       module auto_ptr                        { private header "__memory/auto_ptr.h" }
+      module builtin_new_allocator           { private header "__memory/builtin_new_allocator.h" }
       module compressed_pair                 { private header "__memory/compressed_pair.h" }
       module concepts                        { private header "__memory/concepts.h" }
       module construct_at                    { private header "__memory/construct_at.h" }
+      module destruct_n                      { private header "__memory/destruct_n.h" }
       module pointer_traits                  { private header "__memory/pointer_traits.h" }
       module ranges_construct_at             { private header "__memory/ranges_construct_at.h" }
       module ranges_uninitialized_algorithms { private header "__memory/ranges_uninitialized_algorithms.h" }
       module raw_storage_iterator            { private header "__memory/raw_storage_iterator.h" }
       module shared_ptr                      { private header "__memory/shared_ptr.h" }
       module swap_allocator                  { private header "__memory/swap_allocator.h" }
+      module temp_value                      { private header "__memory/temp_value.h" }
       module temporary_buffer                { private header "__memory/temporary_buffer.h" }
       module uninitialized_algorithms        { private header "__memory/uninitialized_algorithms.h" }
       module unique_ptr                      { private header "__memory/unique_ptr.h" }
@@ -1129,6 +1133,7 @@ module std [system] {
     module integral_constant                   { private header "__type_traits/integral_constant.h" }
     module is_abstract                         { private header "__type_traits/is_abstract.h" }
     module is_aggregate                        { private header "__type_traits/is_aggregate.h" }
+    module is_allocator                        { private header "__type_traits/is_allocator.h" }
     module is_arithmetic                       { private header "__type_traits/is_arithmetic.h" }
     module is_array                            { private header "__type_traits/is_array.h" }
     module is_assignable                       { private header "__type_traits/is_assignable.h" }
@@ -1211,6 +1216,7 @@ module std [system] {
     module maybe_const                         { private header "__type_traits/maybe_const.h" }
     module nat                                 { private header "__type_traits/nat.h" }
     module negation                            { private header "__type_traits/negation.h" }
+    module noexcept_move_assign_container      { private header "__type_traits/noexcept_move_assign_container.h" }
     module promote                             { private header "__type_traits/promote.h" }
     module rank                                { private header "__type_traits/rank.h" }
     module remove_all_extents                  { private header "__type_traits/remove_all_extents.h" }
index 3aea375..139a7f5 100644 (file)
@@ -188,11 +188,11 @@ template<class Callable, class ...Args>
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__memory/shared_ptr.h>
 #include <__mutex_base>
 #include <__threading_support>
 #include <__utility/forward.h>
 #include <cstdint>
-#include <memory>
 #ifndef _LIBCPP_CXX03_LANG
 # include <tuple>
 #endif
index 19fe7b0..c15b058 100644 (file)
@@ -165,9 +165,11 @@ basic_ostream<wchar_t, traits>& operator<<(basic_ostream<wchar_t, traits>&, cons
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__memory/unique_ptr.h>
 #include <bitset>
 #include <ios>
 #include <locale>
+#include <new>
 #include <streambuf>
 #include <version>
 
index 5e4b6ba..f36ccfd 100644 (file)
@@ -956,7 +956,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Comp
 
 _LIBCPP_END_NAMESPACE_STD
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
 #  include <functional>
 #endif
 
index 95a211f..e1799d9 100644 (file)
@@ -770,9 +770,9 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <__iterator/wrap_iter.h>
 #include <__locale>
 #include <__utility/move.h>
+#include <__utility/pair.h>
 #include <__utility/swap.h>
 #include <deque>
-#include <memory>
 #include <stdexcept>
 #include <string>
 #include <vector>
index cf82aff..331d92c 100644 (file)
@@ -111,10 +111,32 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__memory/allocator_traits.h>
+#include <__type_traits/common_type.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/remove_reference.h>
 #include <__utility/forward.h>
-#include <memory>
+#include <__utility/move.h>
+#include <__utility/pair.h>
+#include <__utility/piecewise_construct.h>
+#include <tuple>
 #include <version>
 
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  include <atomic>
+#  include <climits>
+#  include <concepts>
+#  include <cstring>
+#  include <ctime>
+#  include <iterator>
+#  include <memory>
+#  include <ratio>
+#  include <stdexcept>
+#  include <variant>
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
index e251857..f7ce27c 100644 (file)
@@ -480,8 +480,10 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/reverse_iterator.h>
+#include <__memory/allocator.h>
 #include <__node_handle>
 #include <__tree>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
 #include <version>
 
index 26e55ce..44c2045 100644 (file)
@@ -545,9 +545,16 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <__iterator/reverse_iterator.h>
 #include <__iterator/wrap_iter.h>
 #include <__memory/allocate_at_least.h>
+#include <__memory/allocator.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/construct_at.h>
+#include <__memory/pointer_traits.h>
 #include <__memory/swap_allocator.h>
 #include <__string/char_traits.h>
 #include <__string/extern_template_lists.h>
+#include <__type_traits/is_allocator.h>
+#include <__type_traits/noexcept_move_assign_container.h>
 #include <__utility/auto_cast.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
@@ -559,7 +566,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <cstring>
 #include <iosfwd>
 #include <limits>
-#include <memory>
 #include <stdexcept>
 #include <string_view>
 #include <type_traits>
index 85e9275..3ec6293 100644 (file)
@@ -86,6 +86,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <__functional/hash.h>
+#include <__memory/unique_ptr.h>
 #include <__mutex_base>
 #include <__thread/poll_with_backoff.h>
 #include <__thread/timed_backoff_policy.h>
@@ -93,7 +94,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
 #include <__utility/forward.h>
 #include <cstddef>
 #include <iosfwd>
-#include <memory>
 #include <system_error>
 #include <tuple>
 #include <type_traits>
index 38de4d8..2f20ad3 100644 (file)
@@ -525,7 +525,9 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
+#include <__memory/allocator.h>
 #include <__node_handle>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
 #include <stdexcept>
 #include <tuple>
index 2440450..3efc355 100644 (file)
@@ -470,7 +470,9 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
+#include <__memory/allocator.h>
 #include <__node_handle>
+#include <__type_traits/is_allocator.h>
 #include <__utility/forward.h>
 #include <version>
 
index 8b27eaa..4404098 100644 (file)
@@ -293,7 +293,11 @@ erase_if(vector<T, Allocator>& c, Predicate pred);    // C++20
 #include <__memory/allocate_at_least.h>
 #include <__memory/pointer_traits.h>
 #include <__memory/swap_allocator.h>
+#include <__memory/temp_value.h>
+#include <__memory/uninitialized_algorithms.h>
 #include <__split_buffer>
+#include <__type_traits/is_allocator.h>
+#include <__type_traits/noexcept_move_assign_container.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
@@ -302,7 +306,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred);    // C++20
 #include <cstring>
 #include <iosfwd> // for forward declaration of vector
 #include <limits>
-#include <memory>
 #include <stdexcept>
 #include <type_traits>
 #include <version>
index d69f8f2..c822992 100644 (file)
@@ -410,6 +410,7 @@ END-SCRIPT
 #include <__locale> // expected-error@*:* {{use of private header from outside its module: '__locale'}}
 #include <__mbstate_t.h> // expected-error@*:* {{use of private header from outside its module: '__mbstate_t.h'}}
 #include <__memory/addressof.h> // expected-error@*:* {{use of private header from outside its module: '__memory/addressof.h'}}
+#include <__memory/align.h> // expected-error@*:* {{use of private header from outside its module: '__memory/align.h'}}
 #include <__memory/allocate_at_least.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocate_at_least.h'}}
 #include <__memory/allocation_guard.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocation_guard.h'}}
 #include <__memory/allocator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocator.h'}}
@@ -417,15 +418,18 @@ END-SCRIPT
 #include <__memory/allocator_traits.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocator_traits.h'}}
 #include <__memory/assume_aligned.h> // expected-error@*:* {{use of private header from outside its module: '__memory/assume_aligned.h'}}
 #include <__memory/auto_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__memory/auto_ptr.h'}}
+#include <__memory/builtin_new_allocator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/builtin_new_allocator.h'}}
 #include <__memory/compressed_pair.h> // expected-error@*:* {{use of private header from outside its module: '__memory/compressed_pair.h'}}
 #include <__memory/concepts.h> // expected-error@*:* {{use of private header from outside its module: '__memory/concepts.h'}}
 #include <__memory/construct_at.h> // expected-error@*:* {{use of private header from outside its module: '__memory/construct_at.h'}}
+#include <__memory/destruct_n.h> // expected-error@*:* {{use of private header from outside its module: '__memory/destruct_n.h'}}
 #include <__memory/pointer_traits.h> // expected-error@*:* {{use of private header from outside its module: '__memory/pointer_traits.h'}}
 #include <__memory/ranges_construct_at.h> // expected-error@*:* {{use of private header from outside its module: '__memory/ranges_construct_at.h'}}
 #include <__memory/ranges_uninitialized_algorithms.h> // expected-error@*:* {{use of private header from outside its module: '__memory/ranges_uninitialized_algorithms.h'}}
 #include <__memory/raw_storage_iterator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/raw_storage_iterator.h'}}
 #include <__memory/shared_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__memory/shared_ptr.h'}}
 #include <__memory/swap_allocator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/swap_allocator.h'}}
+#include <__memory/temp_value.h> // expected-error@*:* {{use of private header from outside its module: '__memory/temp_value.h'}}
 #include <__memory/temporary_buffer.h> // expected-error@*:* {{use of private header from outside its module: '__memory/temporary_buffer.h'}}
 #include <__memory/uninitialized_algorithms.h> // expected-error@*:* {{use of private header from outside its module: '__memory/uninitialized_algorithms.h'}}
 #include <__memory/unique_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__memory/unique_ptr.h'}}
@@ -549,6 +553,7 @@ END-SCRIPT
 #include <__type_traits/integral_constant.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/integral_constant.h'}}
 #include <__type_traits/is_abstract.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_abstract.h'}}
 #include <__type_traits/is_aggregate.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_aggregate.h'}}
+#include <__type_traits/is_allocator.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_allocator.h'}}
 #include <__type_traits/is_arithmetic.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_arithmetic.h'}}
 #include <__type_traits/is_array.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_array.h'}}
 #include <__type_traits/is_assignable.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_assignable.h'}}
@@ -631,6 +636,7 @@ END-SCRIPT
 #include <__type_traits/maybe_const.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/maybe_const.h'}}
 #include <__type_traits/nat.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/nat.h'}}
 #include <__type_traits/negation.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/negation.h'}}
+#include <__type_traits/noexcept_move_assign_container.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/noexcept_move_assign_container.h'}}
 #include <__type_traits/promote.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/promote.h'}}
 #include <__type_traits/rank.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/rank.h'}}
 #include <__type_traits/remove_all_extents.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/remove_all_extents.h'}}
index f53637d..a17a3fb 100644 (file)
@@ -33,7 +33,7 @@
 // This test is not supported when we remove the transitive includes provided for backwards
 // compatibility. When we bulk-remove them, we'll adjust the includes that are expected by
 // this test instead.
-// XFAIL: transitive-includes-disabled
+// UNSUPPORTED: transitive-includes-disabled
 
 // Prevent <ext/hash_map> from generating deprecated warnings for this test.
 #if defined(__DEPRECATED)
index 2ba3140..af06e12 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 bit
 climits
 cmath
@@ -8,16 +7,11 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
-stdexcept
 tuple
 type_traits
-typeinfo
 version
index 3b7a13d..83db015 100644 (file)
@@ -2,21 +2,16 @@ atomic
 climits
 cmath
 compare
-concepts
 cstddef
 cstdint
 cstdlib
 cstring
 ctime
 exception
-initializer_list
 iosfwd
 limits
-memory
 new
 ratio
-stdexcept
 tuple
 type_traits
-typeinfo
 version
index 9607070..1c742b1 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 climits
 cmath
@@ -9,20 +8,16 @@ cstdint
 cstdio
 cstdlib
 cstring
-ctime
 cwchar
 cwctype
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
 stdexcept
 string
 string_view
 tuple
 type_traits
-typeinfo
 version
index 8e539be..313807a 100644 (file)
@@ -1,5 +1,4 @@
 algorithm
-atomic
 bit
 climits
 cmath
@@ -9,16 +8,11 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
-stdexcept
 tuple
 type_traits
-typeinfo
 version
index 3b7a13d..a85c5dd 100644 (file)
@@ -1,22 +1,9 @@
-atomic
-climits
-cmath
-compare
-concepts
 cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
-initializer_list
-iosfwd
 limits
-memory
 new
-ratio
-stdexcept
-tuple
 type_traits
-typeinfo
 version
index 69067ff..2c337ca 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,7 +5,6 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 experimental/memory_resource
 experimental/utility
@@ -15,13 +12,10 @@ initializer_list
 iosfwd
 limits
 map
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 utility
 version
index 36bd21d..852039a 100644 (file)
@@ -1,24 +1,16 @@
-atomic
-climits
 cmath
 compare
-concepts
 cstddef
 cstdint
 cstdlib
-cstring
-ctime
 exception
 experimental/utility
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 utility
 version
index 1f0e829..97d4fec 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,21 +5,17 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 experimental/memory_resource
 experimental/utility
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 set
 stdexcept
 tuple
 type_traits
-typeinfo
 utility
 version
index bb9f889..5ec4bfe 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 climits
 cmath
@@ -9,7 +8,6 @@ cstdint
 cstdio
 cstdlib
 cstring
-ctime
 cwchar
 cwctype
 exception
@@ -18,14 +16,11 @@ experimental/utility
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
 stdexcept
 string
 string_view
 tuple
 type_traits
-typeinfo
 utility
 version
index c9efa53..c497967 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,21 +5,17 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 experimental/memory_resource
 experimental/utility
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 unordered_map
 utility
 version
index 1b34d3c..9a1b417 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,21 +5,17 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 experimental/memory_resource
 experimental/utility
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 unordered_set
 utility
 version
index b319682..573d3aa 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,17 +5,13 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 version
index 97a5262..616c41e 100644 (file)
@@ -1,4 +1,3 @@
-array
 atomic
 climits
 cmath
@@ -11,18 +10,14 @@ cstring
 ctime
 deque
 exception
-functional
 initializer_list
 iosfwd
 limits
-memory
 new
-optional
 ratio
 stdexcept
 tuple
 type_traits
 typeinfo
-unordered_map
 vector
 version
index 3b7a13d..a25e41c 100644 (file)
@@ -1,22 +1,11 @@
-atomic
-climits
 cmath
 compare
-concepts
 cstddef
 cstdint
 cstdlib
-cstring
-ctime
 exception
-initializer_list
-iosfwd
 limits
-memory
 new
-ratio
-stdexcept
 tuple
 type_traits
-typeinfo
 version
index b319682..573d3aa 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,17 +5,13 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 version
index 30ca93c..8ec7c41 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 cerrno
 climits
@@ -17,7 +16,6 @@ exception
 initializer_list
 iosfwd
 limits
-memory
 new
 ratio
 stdexcept
@@ -26,5 +24,4 @@ string_view
 system_error
 tuple
 type_traits
-typeinfo
 version
index 2cb394a..0b7d2f2 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 climits
 cmath
@@ -9,19 +8,15 @@ cstdint
 cstdio
 cstdlib
 cstring
-ctime
 cwchar
 cwctype
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
 stdexcept
 string_view
 tuple
 type_traits
-typeinfo
 version
index 033d198..fd9ba21 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 cerrno
 climits
@@ -10,20 +9,16 @@ cstdint
 cstdio
 cstdlib
 cstring
-ctime
 cwchar
 cwctype
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
-ratio
 stdexcept
 string
 string_view
 tuple
 type_traits
-typeinfo
 version
index 30ca93c..8ec7c41 100644 (file)
@@ -1,4 +1,3 @@
-atomic
 cctype
 cerrno
 climits
@@ -17,7 +16,6 @@ exception
 initializer_list
 iosfwd
 limits
-memory
 new
 ratio
 stdexcept
@@ -26,5 +24,4 @@ string_view
 system_error
 tuple
 type_traits
-typeinfo
 version
index b319682..573d3aa 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,17 +5,13 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 version
index b319682..573d3aa 100644 (file)
@@ -1,5 +1,3 @@
-atomic
-climits
 cmath
 compare
 concepts
@@ -7,17 +5,13 @@ cstddef
 cstdint
 cstdlib
 cstring
-ctime
 exception
 initializer_list
 iosfwd
 limits
-memory
 new
 optional
-ratio
 stdexcept
 tuple
 type_traits
-typeinfo
 version
index 7891db6..daaf74a 100644 (file)
@@ -18,6 +18,7 @@
 #include <cassert>
 #include <cstddef>
 #include <memory>
+#include <new>
 #include <type_traits>
 #include <utility>
 
index f33dbff..c8e2394 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <cassert>
 #include <concepts>
+#include <cstddef>
 #include <memory>
 
 // check that std::allocation_result exists and isn't restricted to pointers
index b1fc7a6..7e3c41c 100644 (file)
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-#include <memory>
-#include <cstdint>
 #include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
 
 #include "test_macros.h"
 
index d227238..1fc29f7 100644 (file)
@@ -10,8 +10,9 @@
 
 // void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
 
-#include <memory>
 #include <cassert>
+#include <cstddef>
+#include <memory>
 
 #include "test_macros.h"
 
index 2618bd5..c3b6e18 100644 (file)
@@ -40,7 +40,7 @@ int B::population_ = 0;
 struct Nasty
 {
     Nasty() : i_ ( counter_++ ) {}
-    Nasty * operator &() const { return NULL; }
+    Nasty * operator &() const { return nullptr; }
     int i_;
     static int counter_;
 };
index 1a237a7..9d0fae3 100644 (file)
@@ -40,7 +40,7 @@ int B::count_ = 0;
 struct Nasty
 {
     Nasty() : i_ ( counter_++ ) {}
-    Nasty * operator &() const { return NULL; }
+    Nasty * operator &() const { return nullptr; }
     int i_;
     static int counter_;
 };
index 4dfde4f..8b46f1b 100644 (file)
@@ -39,7 +39,7 @@ int B::population_ = 0;
 struct Nasty
 {
     Nasty() : i_ ( counter_++ ) {}
-    Nasty * operator &() const { return NULL; }
+    Nasty * operator &() const { return nullptr; }
     int i_;
     static int counter_;
 };
index 1996ec6..fd6576d 100644 (file)
@@ -40,7 +40,7 @@ int B::population_ = 0;
 struct Nasty
 {
     Nasty() : i_ ( counter_++ ) {}
-    Nasty * operator &() const { return NULL; }
+    Nasty * operator &() const { return nullptr; }
     int i_;
     static int counter_;
 };
index f4578da..0cdaacb 100644 (file)
@@ -10,6 +10,7 @@
 #define ALLOCATORS_H
 
 #include <memory>
+#include <new>
 #include <type_traits>
 #include <utility>
 
index 38fcd51..baf1b50 100644 (file)
@@ -86,6 +86,7 @@
 
 #include <functional>
 #include <cassert>
+#include <new>
 
 #include "test_macros.h"
 
index fa9f04e..1144ae4 100644 (file)
@@ -16,6 +16,8 @@
 #include <cstring>
 #include <cstdint>
 #include <cassert>
+#include <new>
+
 #include "test_macros.h"
 #include "type_id.h"
 
index a216974..529c291 100644 (file)
@@ -16,6 +16,7 @@
 #include <climits>
 #include <iterator>
 #include <memory>
+#include <new>
 
 #include "test_macros.h"
 
index 72940cc..f7e79bd 100644 (file)
 #  endif
 #endif
 
+#include <__threading_support>
+#include <cstring>
 #include <limits.h>
 #include <stdlib.h>
-#include <__threading_support>
+
 #ifndef _LIBCXXABI_HAS_NO_THREADS
 #  if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB)
 #    pragma comment(lib, "pthread")
index e3f0c6d..7da8231 100644 (file)
@@ -26,6 +26,7 @@
 #include <cstdlib>
 #include <cstring>
 #include <limits>
+#include <new>
 #include <utility>
 
 DEMANGLE_NAMESPACE_BEGIN