[libc++] Drop transitive includes by default (#195509)

This patch removes the unused transitive includes by default.
`_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23` can be defined to keep the
transitive includes around for an easier transition. The macro will be
removed in LLVM 24.

This patch implements
https://discourse.llvm.org/t/rfc-remove-unused-transitive-includes-from-the-libc-headers/90157
This commit is contained in:
Nikolas Klauser 2026-06-05 09:45:49 +02:00 committed by GitHub
parent fd6afc5c26
commit ce5b2e8764
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
89 changed files with 128 additions and 117 deletions

View file

@ -1,8 +1,8 @@
// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -fsanitize=thread -o %t
// RUN: %run %t 128
#include <cstdlib>
#include <mutex>
#include <string>
#include <vector>
int main(int argc, char *argv[]) {

View file

@ -60,6 +60,7 @@ Improvements and New Features
for ``std::deque<int>`` iterators.
- ``std::copy(CharT*, CharT*, ostreambuf_iterator<CharT>)`` has been optimized, resulting in performance improvements
of up to 25x.
- A lot of transitive includes have been removed, resulting in significant compile time improvements.
Deprecations and Removals
-------------------------
@ -76,6 +77,11 @@ Deprecations and Removals
Potentially breaking changes
----------------------------
- libc++ has dropped a lot of transitive includes in all language modes. This improves compile time significantly, but
causes programs which rely on these includes to not compile anymore. Any errors caused by this should be fixable by
including the correct header. To ease the transition ``_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23`` can be defined, which
includes the removed headers again. This macro will be removed in LLVM 24.
Announcements About Future Releases
-----------------------------------

View file

@ -17,6 +17,7 @@
#include <__functional/binary_function.h>
#include <__functional/unary_function.h>
#include <__memory/addressof.h>
#include <__new/placement_new_delete.h>
#include <__type_traits/aligned_storage.h>
#include <__type_traits/decay.h>
#include <__type_traits/invoke.h>

View file

@ -2104,11 +2104,11 @@ template <class BidirectionalIterator, class Compare>
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 14
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 14
# include <execution>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <bit>
# include <concepts>

View file

@ -558,11 +558,11 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
# include <chrono>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>
@ -574,7 +574,7 @@ _LIBCPP_POP_MACROS
# include <variant>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <cstring>
# include <limits>
# endif

View file

@ -594,7 +594,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
# include <cstdlib>

View file

@ -630,7 +630,7 @@ template <class T>
# error <atomic> is not implemented
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <compare>
# include <cstddef>

View file

@ -192,7 +192,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <iterator>

View file

@ -90,7 +90,7 @@ namespace std {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstdlib>
# include <iosfwd>
# include <limits>

View file

@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <optional>

View file

@ -104,7 +104,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <concepts>
# include <cstddef>

View file

@ -1148,13 +1148,13 @@ namespace std {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
# include <cstdint>
# include <stdexcept>
# include <string_view>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <bit>
# include <concepts>
# include <cstring>
@ -1164,7 +1164,7 @@ namespace std {
# include <vector>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 20
# include <charconv>
# if _LIBCPP_HAS_LOCALIZATION
# include <locale>

View file

@ -612,7 +612,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -587,7 +587,7 @@ _LIBCPP_END_NAMESPACE_STD
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>

View file

@ -167,7 +167,7 @@ namespace std {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <cstddef>
# include <type_traits>

View file

@ -1484,7 +1484,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <iosfwd>
# include <stdexcept>
# include <type_traits>

View file

@ -161,7 +161,7 @@ namespace std {
# include <version>
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <type_traits>
# endif

View file

@ -350,7 +350,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdint>

View file

@ -61,7 +61,7 @@ struct suspend_always;
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <iosfwd>
# include <limits>

View file

@ -258,7 +258,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp
_LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -2543,7 +2543,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <atomic>
# include <concepts>

View file

@ -91,13 +91,13 @@ template <class E> void rethrow_if_nested(const E& e);
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <new>
# include <type_traits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <cstdlib>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -155,7 +155,7 @@ _LIBCPP_END_NAMESPACE_STD
# endif // _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -124,14 +124,14 @@ _LIBCPP_END_NAMESPACE_LFTS
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <iosfwd>
# include <optional>
# include <type_traits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <locale>
# endif

View file

@ -196,7 +196,7 @@ _LIBCPP_END_NAMESPACE_STD
# endif // _LIBCPP_ENABLE_EXPERIMENTAL
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <limits>
# endif

View file

@ -488,7 +488,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <type_traits>
# endif

View file

@ -88,7 +88,7 @@ inline namespace parallelism_v2 {
# include <experimental/__simd/traits.h>
# include <experimental/__simd/vec_ext.h>
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -151,7 +151,7 @@ constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Ar
_LIBCPP_END_NAMESPACE_LFTS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif

View file

@ -46,7 +46,7 @@ struct erased_type {};
_LIBCPP_END_NAMESPACE_LFTS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -825,7 +825,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multimap<_Key, _Tp, _Has
} // namespace __gnu_cxx
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <iterator>
# include <type_traits>

View file

@ -572,7 +572,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multiset<_Value, _Hash,
} // namespace __gnu_cxx
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <iterator>
# include <type_traits>

View file

@ -568,7 +568,7 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <cstring>

View file

@ -233,11 +233,11 @@ namespace std {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <cmath>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <array>
# include <cctype>
# include <cerrno>

View file

@ -1603,7 +1603,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <atomic>
# include <concepts>

View file

@ -1624,7 +1624,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>
@ -1636,7 +1636,7 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <filesystem>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -577,18 +577,18 @@ POLICY: For non-variadic implementations, the number of arguments is limited
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && defined(_LIBCPP_CXX03_LANG)
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && defined(_LIBCPP_CXX03_LANG)
# include <limits>
# include <new>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 14
# include <array>
# include <initializer_list>
# include <unordered_map>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>
@ -603,7 +603,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited
# include <vector>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 23
# include <__vector/vector.h>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -2065,11 +2065,11 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
# include <chrono>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <cstdlib>
# include <exception>

View file

@ -105,7 +105,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
} // namespace std
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -538,7 +538,7 @@ _LIBCPP_END_NAMESPACE_STD
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <array>
# include <bitset>
# include <deque>
@ -553,7 +553,7 @@ _LIBCPP_END_NAMESPACE_STD
# include <vector>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <locale>
# endif

View file

@ -875,12 +875,12 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <ctime>
# include <ratio>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>

View file

@ -1413,14 +1413,14 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <iosfwd>
# include <ostream>
# include <type_traits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <locale>
# endif

View file

@ -751,11 +751,11 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
# include <variant>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <exception>

View file

@ -128,7 +128,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <cstddef>
# endif

View file

@ -528,7 +528,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -1815,7 +1815,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <atomic>
# include <concepts>

View file

@ -210,7 +210,7 @@ template <class charT> class messages_byname;
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdarg>

View file

@ -2275,7 +2275,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <functional>

View file

@ -987,7 +987,7 @@ template<class Pointer = void, class Smart, class... Args>
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>

View file

@ -69,11 +69,11 @@ namespace std::pmr {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 20
# include <mutex>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <stdexcept>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -837,7 +837,11 @@ module std [system] {
header "__algorithm/stable_sort.h"
export std.memory.unique_temporary_buffer // TODO: Workaround for https://llvm.org/PR120108
}
module swap_ranges { header "__algorithm/swap_ranges.h" }
module swap_ranges {
header "__algorithm/swap_ranges.h"
export std.algorithm.iterator_operations
export std.algorithm.iter_swap
}
module three_way_comp_ref_type { header "__algorithm/three_way_comp_ref_type.h" }
module transform { header "__algorithm/transform.h" }
module uniform_random_bit_generator_adaptor { header "__algorithm/uniform_random_bit_generator_adaptor.h" }
@ -1696,6 +1700,7 @@ module std [system] {
}
module uninitialized_algorithms {
header "__memory/uninitialized_algorithms.h"
export std.memory.destroy
export std.utility.pair
}
module unique_ptr {
@ -1834,7 +1839,10 @@ module std [system] {
module clamp_to_integral { header "__random/clamp_to_integral.h" }
module default_random_engine { header "__random/default_random_engine.h" }
module discard_block_engine { header "__random/discard_block_engine.h" }
module discrete_distribution { header "__random/discrete_distribution.h" }
module discrete_distribution {
header "__random/discrete_distribution.h"
export std.vector.vector
}
module exponential_distribution { header "__random/exponential_distribution.h" }
module extreme_value_distribution { header "__random/extreme_value_distribution.h" }
module fisher_f_distribution { header "__random/fisher_f_distribution.h" }

View file

@ -503,11 +503,11 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <typeinfo>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>

View file

@ -114,7 +114,7 @@ void operator delete[](void* ptr, void*) noexcept; // const
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <type_traits>

View file

@ -159,7 +159,7 @@ _LIBCPP_END_NAMESPACE_STD
# endif // _LIBCPP_STD_VER >= 20
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstddef>
# include <type_traits>

View file

@ -190,12 +190,12 @@ constexpr T saturating_cast(U x) noexcept; // freestanding, S
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 14
# include <initializer_list>
# include <limits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <climits>
# include <cmath>
# include <concepts>

View file

@ -1754,7 +1754,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <climits>
# include <concepts>

View file

@ -193,7 +193,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdio>
@ -206,7 +206,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
# include <type_traits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <locale>
# endif

View file

@ -970,7 +970,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <functional>

View file

@ -1726,7 +1726,7 @@ class piecewise_linear_distribution
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <climits>
# include <cmath>

View file

@ -545,7 +545,7 @@ namespace std {
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstdlib>
# include <iosfwd>
# include <type_traits>

View file

@ -491,7 +491,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -5834,7 +5834,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>

View file

@ -564,7 +564,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <climits>
# include <concepts>

View file

@ -180,7 +180,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <cstddef>
# endif

View file

@ -1569,7 +1569,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <functional>

View file

@ -449,7 +449,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <optional>
# include <system_error>
# endif

View file

@ -636,7 +636,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <array>
# include <concepts>
# include <functional>

View file

@ -1296,7 +1296,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
# if _LIBCPP_STD_VER <= 20 && !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <ostream>
# include <type_traits>
# endif

View file

@ -377,7 +377,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <functional>
# include <type_traits>

View file

@ -282,7 +282,7 @@ _LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <exception>

View file

@ -52,7 +52,7 @@ namespace std {
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <iosfwd>
# endif

View file

@ -438,7 +438,7 @@ _LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstdint>
# include <optional>
# endif

View file

@ -3962,7 +3962,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
# include <cstdlib>

View file

@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
# include <cstdlib>

View file

@ -164,7 +164,7 @@ template <> struct hash<std::error_condition>;
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstdint>
# include <cstring>
# include <limits>

View file

@ -117,11 +117,11 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
# endif // _LIBCPP_HAS_THREADS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
# include <chrono>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstring>
# include <functional>
# include <new>

View file

@ -1458,7 +1458,7 @@ _LIBCPP_POP_MACROS
// clang-format on
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <exception>
# include <iosfwd>

View file

@ -102,7 +102,7 @@ struct hash<type_index> : public __unary_function<type_index, size_t> {
_LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <iosfwd>
# include <new>

View file

@ -389,7 +389,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
}
_LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <type_traits>

View file

@ -2381,7 +2381,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <bit>
# include <cmath>

View file

@ -1848,7 +1848,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <concepts>
# include <cstdlib>

View file

@ -332,14 +332,11 @@ template <class T>
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <limits>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <type_traits>
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

View file

@ -3306,7 +3306,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
# include <cstdlib>

View file

@ -1644,7 +1644,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <exception>
# include <tuple>

View file

@ -348,7 +348,7 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
# include <array>
# include <cerrno>
# include <clocale>
@ -357,7 +357,7 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
# include <typeinfo>
# endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <atomic>
# include <cctype>

View file

@ -46,7 +46,7 @@ if regenerate_expected_results:
normalized_header = re.sub("/", "_", str(header))
print(
f"""\
// RUN: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt
// RUN: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} -D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23 --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt
"""
)
all_traces.append(f"%t/trace-includes.{normalized_header}.txt")
@ -89,7 +89,7 @@ else:
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
// RUN: mkdir %t
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -Wno-deprecated --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23 -Wno-deprecated --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes/to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
// RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
// RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv

View file

@ -13,6 +13,7 @@
// See https://llvm.org/PR20002
#include <functional>
#include <memory>
#include <type_traits>
#include "test_macros.h"

View file

@ -39,11 +39,7 @@ struct Deleter {
};
int main(int, char**) {
#if TEST_STD_VER >= 11
alignas(B) char buffer[sizeof(B)];
#else
std::aligned_storage<sizeof(B), std::alignment_of<B>::value>::type buffer;
#endif
TEST_ALIGNAS(TEST_ALIGNOF(B)) char buffer[sizeof(B)];
B* pb = ::new ((void*)&buffer) B();
std::shared_ptr<B> sp = std::shared_ptr<B>(pb, Deleter());
std::weak_ptr<B> wp = sp;

View file

@ -12,6 +12,7 @@ class TestSharedPtr(TestBase):
@skipIf(compiler=no_match("clang"))
@skipIf(macos_version=["<", "15.0"])
@skipIf(compiler="clang", compiler_version=["<", "17.0"])
@skipIf(bugnumber="https://llvm.org/PR200154")
def test(self):
self.build()

View file

@ -12,6 +12,7 @@ class TestSharedPtr(TestBase):
@skipIf(compiler=no_match("clang"))
@skipIf(compiler="clang", compiler_version=["<", "17.0"])
@skipIf(macos_version=["<", "15.0"])
@skipIf(bugnumber="https://llvm.org/PR200154")
def test(self):
self.build()