Skip to content

[libc++] Granularize <new> includes #119964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libcxx/include/__algorithm/inplace_merge.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <__memory/unique_temporary_buffer.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__algorithm/stable_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__algorithm/stable_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <__type_traits/is_trivially_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__exception/exception_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <__memory/construct_at.h>
#include <__type_traits/decay.h>
#include <cstdlib>
#include <new>
#include <typeinfo>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__functional/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
#include <__verbose_abort>
#include <new>
#include <tuple>
#include <typeinfo>

Expand Down
3 changes: 2 additions & 1 deletion libcxx/include/__memory/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator_traits.h>
#include <__new/allocate.h>
#include <__new/exceptions.h>
#include <__type_traits/is_const.h>
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_void.h>
#include <__type_traits/is_volatile.h>
#include <__utility/forward.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__memory/builtin_new_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <__config>
#include <__cstddef/size_t.h>
#include <__memory/unique_ptr.h>
#include <new>
#include <__new/allocate.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__memory/ranges_construct_at.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <__ranges/dangling.h>
#include <__type_traits/remove_reference.h>
#include <__utility/move.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__memory/raw_storage_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__utility/move.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__memory/shared_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__verbose_abort>
#include <new>
#include <typeinfo>
#if _LIBCPP_HAS_ATOMIC_HEADER
# include <__atomic/memory_order.h>
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__memory/uninitialized_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <__utility/exception_guard.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
3 changes: 2 additions & 1 deletion libcxx/include/__memory/unique_temporary_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#include <__cstddef/ptrdiff_t.h>
#include <__memory/allocator.h>
#include <__memory/unique_ptr.h>
#include <__new/allocate.h>
#include <__new/global_new_delete.h>
#include <__type_traits/is_constant_evaluated.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
3 changes: 2 additions & 1 deletion libcxx/include/__memory_resource/polymorphic_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#include <__cstddef/max_align_t.h>
#include <__fwd/pair.h>
#include <__memory_resource/memory_resource.h>
#include <__new/exceptions.h>
#include <__new/placement_new_delete.h>
#include <__utility/exception_guard.h>
#include <limits>
#include <new>
#include <tuple>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ostream/basic_ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# include <__exception/operations.h>
# include <__memory/shared_ptr.h>
# include <__memory/unique_ptr.h>
# include <__new/exceptions.h>
# include <__ostream/put_character_sequence.h>
# include <__system_error/error_code.h>
# include <__type_traits/conjunction.h>
Expand All @@ -26,7 +27,6 @@
# include <bitset>
# include <ios>
# include <locale>
# include <new> // for __throw_bad_alloc
# include <streambuf>
# include <string_view>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__pstl/backends/libdispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <__memory/allocator.h>
#include <__memory/construct_at.h>
#include <__memory/unique_ptr.h>
#include <__new/exceptions.h>
#include <__numeric/reduce.h>
#include <__pstl/backend_fwd.h>
#include <__pstl/cpu_algos/any_of.h>
Expand All @@ -38,7 +39,6 @@
#include <__utility/exception_guard.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
#include <optional>

_LIBCPP_PUSH_MACROS
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/__pstl/cpu_algos/transform_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <__type_traits/is_arithmetic.h>
#include <__type_traits/is_execution_policy.h>
#include <__utility/move.h>
#include <new>
#include <optional>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__pstl/handle_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#define _LIBCPP___PSTL_HANDLE_EXCEPTION_H

#include <__config>
#include <__new/exceptions.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <new> // __throw_bad_alloc
#include <optional>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__utility/no_destroy.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#define _LIBCPP___UTILITY_NO_DESTROY_H

#include <__config>
#include <__new/placement_new_delete.h>
#include <__type_traits/is_constant_evaluated.h>
#include <__utility/forward.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
3 changes: 2 additions & 1 deletion libcxx/include/__utility/small_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
#include <__cstddef/byte.h>
#include <__cstddef/size_t.h>
#include <__memory/construct_at.h>
#include <__new/allocate.h>
#include <__new/launder.h>
#include <__type_traits/decay.h>
#include <__type_traits/is_trivially_constructible.h>
#include <__type_traits/is_trivially_destructible.h>
#include <__utility/exception_guard.h>
#include <__utility/forward.h>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/exception
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ template <class E> void rethrow_if_nested(const E& e);
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <new>
# include <type_traits>
# endif
#endif // 0
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/future
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
# include <__utility/forward.h>
# include <__utility/move.h>
# include <__utility/swap.h>
# include <new>
# include <stdexcept>
# include <tuple>
# include <version>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/locale
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ template <class charT> class messages_byname;
# include <__locale>
# include <__locale_dir/pad_and_output.h>
# include <__memory/unique_ptr.h>
# include <__new/exceptions.h>
# include <__type_traits/make_unsigned.h>
# include <cerrno>
# include <cstdio>
# include <cstdlib>
# include <ctime>
# include <ios>
# include <limits>
# include <new>
# include <streambuf>
# include <version>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/map
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
# include <__memory/pointer_traits.h>
# include <__memory/unique_ptr.h>
# include <__memory_resource/polymorphic_allocator.h>
# include <__new/launder.h>
# include <__node_handle>
# include <__ranges/concepts.h>
# include <__ranges/container_compatible_range.h>
Expand All @@ -604,7 +605,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
# include <__utility/pair.h>
# include <__utility/piecewise_construct.h>
# include <__utility/swap.h>
# include <new> // for std::launder
# include <stdexcept>
# include <tuple>
# include <version>
Expand Down
6 changes: 5 additions & 1 deletion libcxx/include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,11 @@ module std [system] {
module allocate { header "__new/allocate.h" }
module destroying_delete_t { header "__new/destroying_delete_t.h" }
module exceptions { header "__new/exceptions.h" }
module global_new_delete { header "__new/global_new_delete.h" }
module global_new_delete {
header "__new/global_new_delete.h"

export std.new.nothrow_t
}
module interference_size { header "__new/interference_size.h" }
module launder { header "__new/launder.h" }
module new_handler { header "__new/new_handler.h" }
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/optional
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ namespace std {
# include <__utility/swap.h>
# include <__verbose_abort>
# include <initializer_list>
# include <new>
# include <version>

// standard-mandated includes
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/stdexcept
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ _LIBCPP_END_NAMESPACE_STD
# include <cstdlib>
# include <exception>
# include <iosfwd>
# include <new>
# endif
#endif // 0

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/unordered_map
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
# include <__memory/pointer_traits.h>
# include <__memory/unique_ptr.h>
# include <__memory_resource/polymorphic_allocator.h>
# include <__new/launder.h>
# include <__node_handle>
# include <__ranges/concepts.h>
# include <__ranges/container_compatible_range.h>
Expand All @@ -615,7 +616,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
# include <__type_traits/type_identity.h>
# include <__utility/forward.h>
# include <__utility/pair.h>
# include <new> // launder
# include <stdexcept>
# include <tuple>
# include <version>
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/valarray
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ template <class T> unspecified2 end(const valarray<T>& v);
# include <__utility/move.h>
# include <__utility/swap.h>
# include <cmath>
# include <new>
# include <version>

// standard-mandated includes
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/variant
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ namespace std {
# include <__verbose_abort>
# include <initializer_list>
# include <limits>
# include <new>
# include <version>

// standard-mandated includes
Expand Down
Loading
Loading