diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -379,6 +379,7 @@ __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 @@ __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 @@ __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 @@ __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 diff --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h --- a/libcxx/include/__algorithm/inplace_merge.h +++ b/libcxx/include/__algorithm/inplace_merge.h @@ -23,7 +23,11 @@ #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> #include <__iterator/reverse_iterator.h> -#include +#include <__memory/destruct_n.h> +#include <__memory/temporary_buffer.h> +#include <__memory/unique_ptr.h> +#include <__utility/pair.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__algorithm/ranges_copy.h b/libcxx/include/__algorithm/ranges_copy.h --- a/libcxx/include/__algorithm/ranges_copy.h +++ b/libcxx/include/__algorithm/ranges_copy.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_equal_range.h b/libcxx/include/__algorithm/ranges_equal_range.h --- a/libcxx/include/__algorithm/ranges_equal_range.h +++ b/libcxx/include/__algorithm/ranges_equal_range.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_find_end.h b/libcxx/include/__algorithm/ranges_find_end.h --- a/libcxx/include/__algorithm/ranges_find_end.h +++ b/libcxx/include/__algorithm/ranges_find_end.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_minmax.h b/libcxx/include/__algorithm/ranges_minmax.h --- a/libcxx/include/__algorithm/ranges_minmax.h +++ b/libcxx/include/__algorithm/ranges_minmax.h @@ -23,6 +23,7 @@ #include <__ranges/concepts.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/pair.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/ranges_next_permutation.h b/libcxx/include/__algorithm/ranges_next_permutation.h --- a/libcxx/include/__algorithm/ranges_next_permutation.h +++ b/libcxx/include/__algorithm/ranges_next_permutation.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_partial_sort.h b/libcxx/include/__algorithm/ranges_partial_sort.h --- a/libcxx/include/__algorithm/ranges_partial_sort.h +++ b/libcxx/include/__algorithm/ranges_partial_sort.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_partial_sort_copy.h b/libcxx/include/__algorithm/ranges_partial_sort_copy.h --- a/libcxx/include/__algorithm/ranges_partial_sort_copy.h +++ b/libcxx/include/__algorithm/ranges_partial_sort_copy.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h --- a/libcxx/include/__algorithm/ranges_partition.h +++ b/libcxx/include/__algorithm/ranges_partition.h @@ -26,6 +26,7 @@ #include <__ranges/subrange.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/pair.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/ranges_prev_permutation.h b/libcxx/include/__algorithm/ranges_prev_permutation.h --- a/libcxx/include/__algorithm/ranges_prev_permutation.h +++ b/libcxx/include/__algorithm/ranges_prev_permutation.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_search.h b/libcxx/include/__algorithm/ranges_search.h --- a/libcxx/include/__algorithm/ranges_search.h +++ b/libcxx/include/__algorithm/ranges_search.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_search_n.h b/libcxx/include/__algorithm/ranges_search_n.h --- a/libcxx/include/__algorithm/ranges_search_n.h +++ b/libcxx/include/__algorithm/ranges_search_n.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_set_difference.h b/libcxx/include/__algorithm/ranges_set_difference.h --- a/libcxx/include/__algorithm/ranges_set_difference.h +++ b/libcxx/include/__algorithm/ranges_set_difference.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_unique.h b/libcxx/include/__algorithm/ranges_unique.h --- a/libcxx/include/__algorithm/ranges_unique.h +++ b/libcxx/include/__algorithm/ranges_unique.h @@ -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 diff --git a/libcxx/include/__algorithm/ranges_unique_copy.h b/libcxx/include/__algorithm/ranges_unique_copy.h --- a/libcxx/include/__algorithm/ranges_unique_copy.h +++ b/libcxx/include/__algorithm/ranges_unique_copy.h @@ -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 diff --git a/libcxx/include/__algorithm/set_symmetric_difference.h b/libcxx/include/__algorithm/set_symmetric_difference.h --- a/libcxx/include/__algorithm/set_symmetric_difference.h +++ b/libcxx/include/__algorithm/set_symmetric_difference.h @@ -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 diff --git a/libcxx/include/__algorithm/set_union.h b/libcxx/include/__algorithm/set_union.h --- a/libcxx/include/__algorithm/set_union.h +++ b/libcxx/include/__algorithm/set_union.h @@ -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 diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -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 -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h --- a/libcxx/include/__algorithm/stable_partition.h +++ b/libcxx/include/__algorithm/stable_partition.h @@ -15,7 +15,11 @@ #include <__iterator/advance.h> #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> -#include +#include <__memory/destruct_n.h> +#include <__memory/temporary_buffer.h> +#include <__memory/unique_ptr.h> +#include <__utility/pair.h> +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h --- a/libcxx/include/__algorithm/stable_sort.h +++ b/libcxx/include/__algorithm/stable_sort.h @@ -16,8 +16,12 @@ #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 +#include <__utility/pair.h> +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__bsd_locale_fallbacks.h b/libcxx/include/__bsd_locale_fallbacks.h --- a/libcxx/include/__bsd_locale_fallbacks.h +++ b/libcxx/include/__bsd_locale_fallbacks.h @@ -13,7 +13,6 @@ #ifndef _LIBCPP___BSD_LOCALE_FALLBACKS_H #define _LIBCPP___BSD_LOCALE_FALLBACKS_H -#include #include #include diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h --- a/libcxx/include/__filesystem/filesystem_error.h +++ b/libcxx/include/__filesystem/filesystem_error.h @@ -14,6 +14,7 @@ #include <__config> #include <__filesystem/path.h> #include <__memory/shared_ptr.h> +#include <__utility/forward.h> #include #include #include diff --git a/libcxx/include/__format/format_arg_store.h b/libcxx/include/__format/format_arg_store.h --- a/libcxx/include/__format/format_arg_store.h +++ b/libcxx/include/__format/format_arg_store.h @@ -19,6 +19,7 @@ #include <__config> #include <__format/concepts.h> #include <__format/format_arg.h> +#include <__utility/forward.h> #include #include #include diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -17,15 +17,19 @@ #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 <__utility/forward.h> #include <__utility/move.h> +#include <__utility/piecewise_construct.h> #include <__utility/swap.h> #include -#include // TODO: replace with <__memory/__builtin_new_allocator.h> +#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -18,12 +18,19 @@ #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 #include -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -12,10 +12,10 @@ #include <__availability> #include <__config> +#include <__memory/shared_ptr.h> #include #include #include -#include #include #include diff --git a/libcxx/include/__memory/align.h b/libcxx/include/__memory/align.h new file mode 100644 --- /dev/null +++ b/libcxx/include/__memory/align.h @@ -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 + +#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 --- /dev/null +++ b/libcxx/include/__memory/builtin_new_allocator.h @@ -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 +#include + +#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` 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 __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 + _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE + static __holder_t __allocate_type(size_t __n) { + return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); + } + + template + _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 diff --git a/libcxx/include/__memory/construct_at.h b/libcxx/include/__memory/construct_at.h --- a/libcxx/include/__memory/construct_at.h +++ b/libcxx/include/__memory/construct_at.h @@ -17,6 +17,7 @@ #include <__memory/voidify.h> #include <__utility/forward.h> #include <__utility/move.h> +#include #include #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 --- /dev/null +++ b/libcxx/include/__memory/destruct_n.h @@ -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 + +#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 + _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT + {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();} + + template + _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 + _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT + {__incr(integral_constant::value>());} + + template + _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT + {__set(__s, integral_constant::value>());} + + template + _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT + {__process(__p, integral_constant::value>());} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_DESTRUCT_N_H diff --git a/libcxx/include/__memory/ranges_construct_at.h b/libcxx/include/__memory/ranges_construct_at.h --- a/libcxx/include/__memory/ranges_construct_at.h +++ b/libcxx/include/__memory/ranges_construct_at.h @@ -22,6 +22,7 @@ #include <__utility/declval.h> #include <__utility/forward.h> #include <__utility/move.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/libcxx/include/__memory/ranges_uninitialized_algorithms.h --- a/libcxx/include/__memory/ranges_uninitialized_algorithms.h +++ b/libcxx/include/__memory/ranges_uninitialized_algorithms.h @@ -24,6 +24,7 @@ #include <__ranges/concepts.h> #include <__ranges/dangling.h> #include <__utility/move.h> +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__memory/raw_storage_iterator.h b/libcxx/include/__memory/raw_storage_iterator.h --- a/libcxx/include/__memory/raw_storage_iterator.h +++ b/libcxx/include/__memory/raw_storage_iterator.h @@ -16,6 +16,7 @@ #include <__memory/addressof.h> #include <__utility/move.h> #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header 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 @@ -34,6 +34,7 @@ #include #include // abort #include +#include #include #include #include diff --git a/libcxx/include/__memory/temp_value.h b/libcxx/include/__memory/temp_value.h new file mode 100644 --- /dev/null +++ b/libcxx/include/__memory/temp_value.h @@ -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 +struct __temp_value { + typedef allocator_traits<_Alloc> _Traits; + +#ifdef _LIBCPP_CXX03_LANG + typename aligned_storage::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 + _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 diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h --- a/libcxx/include/__memory/uninitialized_algorithms.h +++ b/libcxx/include/__memory/uninitialized_algorithms.h @@ -24,6 +24,7 @@ #include <__utility/move.h> #include <__utility/pair.h> #include <__utility/transaction.h> +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -60,7 +60,8 @@ #include <__assert> #include <__config> -#include +#include <__memory/allocator_traits.h> +#include <__memory/pointer_traits.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -17,11 +17,15 @@ #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 +#include <__utility/move.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -17,12 +17,17 @@ #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 -#include #include #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 --- /dev/null +++ b/libcxx/include/__type_traits/is_allocator.h @@ -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 + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct __is_allocator : false_type {}; + +template +struct __is_allocator<_Alloc, + typename __void_t::type, + typename __void_t().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 --- /dev/null +++ b/libcxx/include/__type_traits/noexcept_move_assign_container.h @@ -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 > +struct __noexcept_move_assign_container : public integral_constant 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 diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -1709,7 +1709,6 @@ #include <__debug> #include #include -#include #include #include @@ -1900,8 +1899,11 @@ #include <__algorithm/upper_bound.h> #ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include # include # include +# include +# include # include #endif @@ -1913,7 +1915,7 @@ #endif #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 -# include <__pstl_algorithm> +# include <__pstl_algorithm> #endif #endif // _LIBCPP_ALGORITHM diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -83,19 +83,25 @@ #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 #include -#include #include #include #include #ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES # include +# include +# include +# include #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -48,10 +48,19 @@ #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 #include -#include + +#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include +# include +# include +# include +# include +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -108,8 +108,9 @@ #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 #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -176,7 +176,11 @@ #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> diff --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine --- a/libcxx/include/experimental/coroutine +++ b/libcxx/include/experimental/coroutine @@ -50,10 +50,29 @@ #include <__functional/operations.h> #include #include -#include // for hash #include #include +#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource --- a/libcxx/include/experimental/memory_resource +++ b/libcxx/include/experimental/memory_resource @@ -65,6 +65,7 @@ */ #include <__assert> // all public C++ headers provide the assertion handler +#include <__memory/allocator_traits.h> #include <__tuple> #include <__utility/move.h> #include @@ -72,11 +73,24 @@ #include #include #include -#include #include #include +#include #include +#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -188,10 +188,18 @@ #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 -#include #include #include diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -192,6 +192,7 @@ #include #include #include +#include #include #if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -533,7 +533,6 @@ #include <__utility/forward.h> #include #include -#include #include #include #include diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -372,8 +372,8 @@ #include <__utility/forward.h> #include <__utility/move.h> #include -#include #include +#include #include #include #include diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -194,12 +194,19 @@ #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 -#include #include #include diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -201,13 +201,14 @@ #include <__iterator/istreambuf_iterator.h> #include <__iterator/ostreambuf_iterator.h> #include <__locale> +#include <__memory/unique_ptr.h> #include // TODO: Remove this include #include #include #include #include #include -#include +#include #include #include diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -538,11 +538,14 @@ #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 +#include #include #include diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -852,11 +852,10 @@ */ -#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> @@ -876,19 +875,19 @@ #include <__memory/uninitialized_algorithms.h> #include <__memory/unique_ptr.h> #include <__memory/uses_allocator.h> -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include +# include +# include +# include # include +# include +# include +# include +# include +# include # include #endif @@ -899,147 +898,6 @@ # pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -struct __destruct_n -{ -private: - size_t __size_; - - template - _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT - {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();} - - template - _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 - _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT - {__incr(integral_constant::value>());} - - template - _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT - {__set(__s, integral_constant::value>());} - - template - _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT - {__process(__p, integral_constant::value>());} -}; - -_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space); - -template > -struct __noexcept_move_assign_container : public integral_constant 14 - || _Traits::is_always_equal::value -#else - && is_nothrow_move_assignable<_Alloc>::value -#endif - > {}; - - -template -struct __temp_value { - typedef allocator_traits<_Alloc> _Traits; - -#ifdef _LIBCPP_CXX03_LANG - typename aligned_storage::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 - _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 -struct __is_allocator : false_type {}; - -template -struct __is_allocator<_Alloc, - typename __void_t::type, - typename __void_t().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` 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 __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 - _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE - static __holder_t __allocate_type(size_t __n) { - return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); - } - - template - _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 diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -188,11 +188,11 @@ #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 -#include #ifndef _LIBCPP_CXX03_LANG # include #endif diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -165,9 +165,11 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> +#include <__memory/unique_ptr.h> #include #include #include +#include #include #include diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -772,7 +772,6 @@ #include <__utility/move.h> #include <__utility/swap.h> #include -#include #include #include #include diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -111,10 +111,33 @@ #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 +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/piecewise_construct.h> +#include #include +#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -480,8 +480,10 @@ #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 diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -545,9 +545,15 @@ #include <__iterator/reverse_iterator.h> #include <__iterator/wrap_iter.h> #include <__memory/allocate_at_least.h> +#include <__memory/allocator.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 +565,6 @@ #include #include #include -#include #include #include #include diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -86,6 +86,7 @@ #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 @@ #include <__utility/forward.h> #include #include -#include #include #include #include diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -525,7 +525,9 @@ #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 #include diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -470,7 +470,9 @@ #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 diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -293,7 +293,11 @@ #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 @@ #include #include // for forward declaration of vector #include -#include #include #include #include diff --git a/libcxx/test/libcxx/memory/compressed_pair/compressed_pair.pass.cpp b/libcxx/test/libcxx/memory/compressed_pair/compressed_pair.pass.cpp --- a/libcxx/test/libcxx/memory/compressed_pair/compressed_pair.pass.cpp +++ b/libcxx/test/libcxx/memory/compressed_pair/compressed_pair.pass.cpp @@ -8,6 +8,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/libcxx/private_headers.verify.cpp b/libcxx/test/libcxx/private_headers.verify.cpp --- a/libcxx/test/libcxx/private_headers.verify.cpp +++ b/libcxx/test/libcxx/private_headers.verify.cpp @@ -410,6 +410,7 @@ #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 @@ #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 @@ #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 @@ #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'}} diff --git a/libcxx/test/libcxx/utilities/any/allocator.pass.cpp b/libcxx/test/libcxx/utilities/any/allocator.pass.cpp --- a/libcxx/test/libcxx/utilities/any/allocator.pass.cpp +++ b/libcxx/test/libcxx/utilities/any/allocator.pass.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp b/libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp --- a/libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp +++ b/libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp @@ -13,6 +13,8 @@ #include #include +#include + #include "test_macros.h" struct Irrelevant; diff --git a/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp b/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp --- a/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp +++ b/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp @@ -9,6 +9,7 @@ // UNSUPPORTED: c++03 #include +#include template struct Tag {}; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "test_iterators.h" diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp --- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp +++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp --- a/libcxx/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp --- a/libcxx/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp --- a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp +++ b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp --- a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp +++ b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp b/libcxx/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp --- a/libcxx/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp @@ -12,6 +12,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp @@ -20,6 +20,7 @@ #include #include +#include #include "test_macros.h" #include "min_allocator.h" diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp --- a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp +++ b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "test_macros.h" #include "incomplete_type_helper.h" diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp --- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp +++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp --- a/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp +++ b/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp @@ -10,6 +10,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp b/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp --- a/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp +++ b/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp @@ -15,6 +15,8 @@ #include #include +#include + #include "test_macros.h" struct Irrelevant; diff --git a/libcxx/test/std/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp b/libcxx/test/std/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp --- a/libcxx/test/std/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp +++ b/libcxx/test/std/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp b/libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp --- a/libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp +++ b/libcxx/test/std/utilities/memory/pointer.traits/pointer_to.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp b/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp --- a/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp +++ b/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp @@ -27,6 +27,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp b/libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp --- a/libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp +++ b/libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp @@ -20,6 +20,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_copy_move.fail.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_copy_move.fail.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_copy_move.fail.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_copy_move.fail.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "test_macros.h" #include "count_new.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp @@ -20,8 +20,10 @@ #include "test_macros.h" -#include #include +#include +#include +#include static bool construct_called = false; static bool destroy_called = false; diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp @@ -15,6 +15,7 @@ // bad_weak_ptr(); // }; +#include #include #include #include diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp --- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp +++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include "test_macros.h" struct Deleter { diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "test_macros.h" #include "MoveOnly.h" diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include "test_macros.h" struct UserType {}; diff --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h --- a/libcxx/test/support/allocators.h +++ b/libcxx/test/support/allocators.h @@ -10,6 +10,7 @@ #define ALLOCATORS_H #include +#include #include #include diff --git a/libcxx/test/support/container_test_types.h b/libcxx/test/support/container_test_types.h --- a/libcxx/test/support/container_test_types.h +++ b/libcxx/test/support/container_test_types.h @@ -86,6 +86,7 @@ #include #include +#include #include "test_macros.h" diff --git a/libcxx/test/support/controlled_allocators.h b/libcxx/test/support/controlled_allocators.h --- a/libcxx/test/support/controlled_allocators.h +++ b/libcxx/test/support/controlled_allocators.h @@ -16,6 +16,8 @@ #include #include #include +#include + #include "test_macros.h" #include "type_id.h" diff --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h --- a/libcxx/test/support/min_allocator.h +++ b/libcxx/test/support/min_allocator.h @@ -16,6 +16,7 @@ #include #include #include +#include #include "test_macros.h"