[libcxx-commits] [libcxx] 6c47654 - Revert "[libc++] Remove the type_traits includes from limits and new"
Ian Anderson via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 7 17:53:14 PDT 2023
Author: Ian Anderson
Date: 2023-07-07T17:53:09-07:00
New Revision: 6c47654efd36dd8fdbf089b485a1c594a354e421
URL: https://github.com/llvm/llvm-project/commit/6c47654efd36dd8fdbf089b485a1c594a354e421
DIFF: https://github.com/llvm/llvm-project/commit/6c47654efd36dd8fdbf089b485a1c594a354e421.diff
LOG: Revert "[libc++] Remove the type_traits includes from limits and new"
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 2af6d79c7e38675a184280a2d6a92550702581f7.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D154747
Added:
Modified:
libcxx/docs/ReleaseNotes.rst
libcxx/include/limits
libcxx/include/new
libcxx/test/libcxx/transitive_includes/cxx03.csv
libcxx/test/libcxx/transitive_includes/cxx11.csv
libcxx/test/libcxx/transitive_includes/cxx14.csv
libcxx/test/libcxx/transitive_includes/cxx17.csv
libcxx/test/libcxx/transitive_includes/cxx20.csv
Removed:
################################################################################
diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index cfed0b0949f299..c838c2a54a8071 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -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>``
diff --git a/libcxx/include/limits b/libcxx/include/limits
index cf6a23fe923f93..9f5949e63cff01 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -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
diff --git a/libcxx/include/new b/libcxx/include/new
index a8eff3508b3c91..3064a0e2f0808f 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -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
diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv
index 4183dd9f9361e3..75df8fdf86462f 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx03.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv
@@ -458,6 +458,7 @@ latch limits
latch ratio
latch type_traits
latch version
+limits type_traits
limits version
list algorithm
list atomic
@@ -573,6 +574,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
+new exception
+new type_traits
new version
numbers concepts
numbers type_traits
@@ -639,7 +642,6 @@ ostream version
queue compare
queue concepts
queue cstddef
-queue cstdint
queue cstdlib
queue deque
queue functional
@@ -776,7 +778,6 @@ sstream version
stack compare
stack concepts
stack cstddef
-stack cstdint
stack deque
stack functional
stack initializer_list
@@ -939,7 +940,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
-valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv
index ded67478b71142..4bd5b1bde1fef1 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -458,6 +458,7 @@ latch limits
latch ratio
latch type_traits
latch version
+limits type_traits
limits version
list algorithm
list atomic
@@ -574,6 +575,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
+new exception
+new type_traits
new version
numbers concepts
numbers type_traits
@@ -640,7 +643,6 @@ ostream version
queue compare
queue concepts
queue cstddef
-queue cstdint
queue cstdlib
queue deque
queue functional
@@ -777,7 +779,6 @@ sstream version
stack compare
stack concepts
stack cstddef
-stack cstdint
stack deque
stack functional
stack initializer_list
@@ -940,7 +941,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
-valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv
index 4ef59730bbb85c..010b208f68efa3 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -460,6 +460,7 @@ latch limits
latch ratio
latch type_traits
latch version
+limits type_traits
limits version
list algorithm
list atomic
@@ -576,6 +577,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
+new exception
+new type_traits
new version
numbers concepts
numbers type_traits
@@ -642,7 +645,6 @@ ostream version
queue compare
queue concepts
queue cstddef
-queue cstdint
queue cstdlib
queue deque
queue functional
@@ -779,7 +781,6 @@ sstream version
stack compare
stack concepts
stack cstddef
-stack cstdint
stack deque
stack functional
stack initializer_list
@@ -942,7 +943,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
-valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv
index 4ef59730bbb85c..010b208f68efa3 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -460,6 +460,7 @@ latch limits
latch ratio
latch type_traits
latch version
+limits type_traits
limits version
list algorithm
list atomic
@@ -576,6 +577,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
+new exception
+new type_traits
new version
numbers concepts
numbers type_traits
@@ -642,7 +645,6 @@ ostream version
queue compare
queue concepts
queue cstddef
-queue cstdint
queue cstdlib
queue deque
queue functional
@@ -779,7 +781,6 @@ sstream version
stack compare
stack concepts
stack cstddef
-stack cstdint
stack deque
stack functional
stack initializer_list
@@ -942,7 +943,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
-valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv
index a081de77c5e91b..9ef5cb4548d421 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -466,6 +466,7 @@ latch limits
latch ratio
latch type_traits
latch version
+limits type_traits
limits version
list algorithm
list atomic
@@ -582,6 +583,8 @@ mutex typeinfo
mutex version
new cstddef
new cstdlib
+new exception
+new type_traits
new version
numbers concepts
numbers type_traits
@@ -648,7 +651,6 @@ ostream version
queue compare
queue concepts
queue cstddef
-queue cstdint
queue cstdlib
queue deque
queue functional
@@ -785,7 +787,6 @@ sstream version
stack compare
stack concepts
stack cstddef
-stack cstdint
stack deque
stack functional
stack initializer_list
@@ -947,7 +948,6 @@ valarray algorithm
valarray cmath
valarray concepts
valarray cstddef
-valarray cstdint
valarray cstdlib
valarray cstring
valarray functional
More information about the libcxx-commits
mailing list