Skip to content

Commit

Permalink
Revert "[libc++] Remove the type_traits includes from limits and new"
Browse files Browse the repository at this point in the history
type_traits doesn't need to include __type_traits/noexcept_move_assign_container.h, so there is no include cycle from <limits> or <new>. Restore their includes of type_traits to preserve compatibility.

This reverts commit 2af6d79.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D154747
  • Loading branch information
ian-twilightcoder committed Jul 8, 2023
1 parent ffbc08d commit 6c47654
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 19 deletions.
4 changes: 0 additions & 4 deletions libcxx/docs/ReleaseNotes.rst
Expand Up @@ -95,10 +95,6 @@ Deprecations and Removals

- ``<algorithm>`` no longer includes ``<chrono>`` in any C++ version (it was previously included in C++17 and earlier).

- ``<limits>`` no longer includes ``<type_traits>`` in any C++ version (it was previously included in C++20 and earlier).

- ``<new>`` no longer includes ``<exception>`` or ``<type_traits>`` in any C++ version (they were previously included in C++20 and earlier).

- ``<string>`` no longer includes ``<vector>`` in any C++ version (it was previously included in C++20 and earlier).

- ``<string>``, ``<string_view>``, and ``<mutex>`` no longer include ``<functional>``
Expand Down
4 changes: 4 additions & 0 deletions libcxx/include/limits
Expand Up @@ -823,4 +823,8 @@ _LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
#endif

#endif // _LIBCPP_LIMITS
5 changes: 5 additions & 0 deletions libcxx/include/new
Expand Up @@ -365,4 +365,9 @@ inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUC

_LIBCPP_END_NAMESPACE_STD

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <exception>
# include <type_traits>
#endif

#endif // _LIBCPP_NEW
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/transitive_includes/cxx03.csv
Expand Up @@ -458,6 +458,7 @@ latch limits
latch ratio
latch type_traits
latch version
limits type_traits
limits version
list algorithm
list atomic
Expand Down Expand Up @@ -573,6 +574,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
new exception
new type_traits
new version
numbers concepts
numbers type_traits
Expand Down Expand Up @@ -639,7 +642,6 @@ ostream version
queue compare
queue concepts
queue cstddef
queue cstdint
queue cstdlib
queue deque
queue functional
Expand Down Expand Up @@ -776,7 +778,6 @@ sstream version
stack compare
stack concepts
stack cstddef
stack cstdint
stack deque
stack functional
stack initializer_list
Expand Down Expand Up @@ -939,7 +940,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/transitive_includes/cxx11.csv
Expand Up @@ -458,6 +458,7 @@ latch limits
latch ratio
latch type_traits
latch version
limits type_traits
limits version
list algorithm
list atomic
Expand Down Expand Up @@ -574,6 +575,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
new exception
new type_traits
new version
numbers concepts
numbers type_traits
Expand Down Expand Up @@ -640,7 +643,6 @@ ostream version
queue compare
queue concepts
queue cstddef
queue cstdint
queue cstdlib
queue deque
queue functional
Expand Down Expand Up @@ -777,7 +779,6 @@ sstream version
stack compare
stack concepts
stack cstddef
stack cstdint
stack deque
stack functional
stack initializer_list
Expand Down Expand Up @@ -940,7 +941,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/transitive_includes/cxx14.csv
Expand Up @@ -460,6 +460,7 @@ latch limits
latch ratio
latch type_traits
latch version
limits type_traits
limits version
list algorithm
list atomic
Expand Down Expand Up @@ -576,6 +577,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
new exception
new type_traits
new version
numbers concepts
numbers type_traits
Expand Down Expand Up @@ -642,7 +645,6 @@ ostream version
queue compare
queue concepts
queue cstddef
queue cstdint
queue cstdlib
queue deque
queue functional
Expand Down Expand Up @@ -779,7 +781,6 @@ sstream version
stack compare
stack concepts
stack cstddef
stack cstdint
stack deque
stack functional
stack initializer_list
Expand Down Expand Up @@ -942,7 +943,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/transitive_includes/cxx17.csv
Expand Up @@ -460,6 +460,7 @@ latch limits
latch ratio
latch type_traits
latch version
limits type_traits
limits version
list algorithm
list atomic
Expand Down Expand Up @@ -576,6 +577,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
new exception
new type_traits
new version
numbers concepts
numbers type_traits
Expand Down Expand Up @@ -642,7 +645,6 @@ ostream version
queue compare
queue concepts
queue cstddef
queue cstdint
queue cstdlib
queue deque
queue functional
Expand Down Expand Up @@ -779,7 +781,6 @@ sstream version
stack compare
stack concepts
stack cstddef
stack cstdint
stack deque
stack functional
stack initializer_list
Expand Down Expand Up @@ -942,7 +943,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/transitive_includes/cxx20.csv
Expand Up @@ -466,6 +466,7 @@ latch limits
latch ratio
latch type_traits
latch version
limits type_traits
limits version
list algorithm
list atomic
Expand Down Expand Up @@ -582,6 +583,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
new exception
new type_traits
new version
numbers concepts
numbers type_traits
Expand Down Expand Up @@ -648,7 +651,6 @@ ostream version
queue compare
queue concepts
queue cstddef
queue cstdint
queue cstdlib
queue deque
queue functional
Expand Down Expand Up @@ -785,7 +787,6 @@ sstream version
stack compare
stack concepts
stack cstddef
stack cstdint
stack deque
stack functional
stack initializer_list
Expand Down Expand Up @@ -947,7 +948,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
Expand Down

0 comments on commit 6c47654

Please sign in to comment.