[libcxx-commits] [libcxx] [libc++] Remove <queue> and <stack> includes from <format> (PR #85520)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 25 00:49:28 PDT 2024
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/85520
>From b157ad84c229f2d1316f9dd10d5e26be504d60ac Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Thu, 7 Mar 2024 17:16:50 +0100
Subject: [PATCH] [libc++] Remove <queue> and <stack> includes from <format>
This reduces the include time of <format> from 691ms to 556ms.
---
libcxx/include/CMakeLists.txt | 5 +++
libcxx/include/__format/container_adaptor.h | 4 +--
libcxx/include/__fwd/deque.h | 26 ++++++++++++++++
libcxx/include/__fwd/memory.h | 25 +++++++++++++++
libcxx/include/__fwd/queue.h | 31 +++++++++++++++++++
libcxx/include/__fwd/sstream.h | 1 +
libcxx/include/__fwd/stack.h | 26 ++++++++++++++++
libcxx/include/__fwd/string.h | 4 +--
libcxx/include/__fwd/vector.h | 26 ++++++++++++++++
libcxx/include/deque | 4 +--
libcxx/include/format | 2 ++
libcxx/include/iosfwd | 5 +--
libcxx/include/libcxx.imp | 5 +++
libcxx/include/module.modulemap | 9 ++++++
libcxx/include/queue | 7 ++---
libcxx/include/stack | 4 +--
libcxx/include/vector | 3 +-
.../test/libcxx/transitive_includes/cxx03.csv | 1 +
.../test/libcxx/transitive_includes/cxx11.csv | 1 +
.../test/libcxx/transitive_includes/cxx14.csv | 1 +
.../test/libcxx/transitive_includes/cxx17.csv | 1 +
.../test/libcxx/transitive_includes/cxx20.csv | 1 +
.../test/libcxx/transitive_includes/cxx23.csv | 4 +--
.../test/libcxx/transitive_includes/cxx26.csv | 4 +--
.../vector/vector.cons/deduct.verify.cpp | 29 +++++++----------
.../support/deduction_guides_sfinae_checks.h | 1 +
26 files changed, 187 insertions(+), 43 deletions(-)
create mode 100644 libcxx/include/__fwd/deque.h
create mode 100644 libcxx/include/__fwd/memory.h
create mode 100644 libcxx/include/__fwd/queue.h
create mode 100644 libcxx/include/__fwd/stack.h
create mode 100644 libcxx/include/__fwd/vector.h
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 6ed8d21d98a15a..d0342a9758dea9 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -429,22 +429,27 @@ set(files
__fwd/array.h
__fwd/bit_reference.h
__fwd/complex.h
+ __fwd/deque.h
__fwd/format.h
__fwd/fstream.h
__fwd/functional.h
__fwd/ios.h
__fwd/istream.h
__fwd/mdspan.h
+ __fwd/memory.h
__fwd/memory_resource.h
__fwd/ostream.h
__fwd/pair.h
+ __fwd/queue.h
__fwd/span.h
__fwd/sstream.h
+ __fwd/stack.h
__fwd/streambuf.h
__fwd/string.h
__fwd/string_view.h
__fwd/subrange.h
__fwd/tuple.h
+ __fwd/vector.h
__hash_table
__ios/fpos.h
__iterator/access.h
diff --git a/libcxx/include/__format/container_adaptor.h b/libcxx/include/__format/container_adaptor.h
index ec806ef16bf528..9f49ca03bf4f50 100644
--- a/libcxx/include/__format/container_adaptor.h
+++ b/libcxx/include/__format/container_adaptor.h
@@ -18,11 +18,11 @@
#include <__format/concepts.h>
#include <__format/formatter.h>
#include <__format/range_default_formatter.h>
+#include <__fwd/queue.h>
+#include <__fwd/stack.h>
#include <__ranges/ref_view.h>
#include <__type_traits/is_const.h>
#include <__type_traits/maybe_const.h>
-#include <queue>
-#include <stack>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__fwd/deque.h b/libcxx/include/__fwd/deque.h
new file mode 100644
index 00000000000000..fd2fb5bb4b8e92
--- /dev/null
+++ b/libcxx/include/__fwd/deque.h
@@ -0,0 +1,26 @@
+//===---------------------------------------------------------------------===//
+//
+// 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___FWD_DEQUE_H
+#define _LIBCPP___FWD_DEQUE_H
+
+#include <__config>
+#include <__fwd/memory.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Allocator = allocator<_Tp> >
+class _LIBCPP_TEMPLATE_VIS deque;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_DEQUE_H
diff --git a/libcxx/include/__fwd/memory.h b/libcxx/include/__fwd/memory.h
new file mode 100644
index 00000000000000..b9e151855ad7d8
--- /dev/null
+++ b/libcxx/include/__fwd/memory.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___FWD_MEMORY_H
+#define _LIBCPP___FWD_MEMORY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS allocator;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_MEMORY_H
diff --git a/libcxx/include/__fwd/queue.h b/libcxx/include/__fwd/queue.h
new file mode 100644
index 00000000000000..50d99ad9c29f45
--- /dev/null
+++ b/libcxx/include/__fwd/queue.h
@@ -0,0 +1,31 @@
+//===---------------------------------------------------------------------===//
+//
+// 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___FWD_QUEUE_H
+#define _LIBCPP___FWD_QUEUE_H
+
+#include <__config>
+#include <__functional/operations.h>
+#include <__fwd/deque.h>
+#include <__fwd/vector.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Container = deque<_Tp> >
+class _LIBCPP_TEMPLATE_VIS queue;
+
+template <class _Tp, class _Container = vector<_Tp>, class _Compare = less<typename _Container::value_type> >
+class _LIBCPP_TEMPLATE_VIS priority_queue;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_QUEUE_H
diff --git a/libcxx/include/__fwd/sstream.h b/libcxx/include/__fwd/sstream.h
index e2d46fbe1d9bb4..39a9c3faf1f800 100644
--- a/libcxx/include/__fwd/sstream.h
+++ b/libcxx/include/__fwd/sstream.h
@@ -10,6 +10,7 @@
#define _LIBCPP___FWD_SSTREAM_H
#include <__config>
+#include <__fwd/memory.h>
#include <__fwd/string.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__fwd/stack.h b/libcxx/include/__fwd/stack.h
new file mode 100644
index 00000000000000..7dab6c1a4f4e2e
--- /dev/null
+++ b/libcxx/include/__fwd/stack.h
@@ -0,0 +1,26 @@
+//===---------------------------------------------------------------------===//
+//
+// 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___FWD_STACK_H
+#define _LIBCPP___FWD_STACK_H
+
+#include <__config>
+#include <__fwd/deque.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Container = deque<_Tp> >
+class _LIBCPP_TEMPLATE_VIS stack;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_STACK_H
diff --git a/libcxx/include/__fwd/string.h b/libcxx/include/__fwd/string.h
index 032132374de5ed..320c4e4c818361 100644
--- a/libcxx/include/__fwd/string.h
+++ b/libcxx/include/__fwd/string.h
@@ -11,6 +11,7 @@
#include <__availability>
#include <__config>
+#include <__fwd/memory.h>
#include <__fwd/memory_resource.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -39,9 +40,6 @@ template <>
struct char_traits<wchar_t>;
#endif
-template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator;
-
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_string;
diff --git a/libcxx/include/__fwd/vector.h b/libcxx/include/__fwd/vector.h
new file mode 100644
index 00000000000000..c9cc96137449f8
--- /dev/null
+++ b/libcxx/include/__fwd/vector.h
@@ -0,0 +1,26 @@
+//===---------------------------------------------------------------------===//
+//
+// 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___FWD_VECTOR_H
+#define _LIBCPP___FWD_VECTOR_H
+
+#include <__config>
+#include <__fwd/memory.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Alloc = allocator<_Tp> >
+class _LIBCPP_TEMPLATE_VIS vector;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_VECTOR_H
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 85ea9c6f661ed6..a6472e46d426c7 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -192,6 +192,7 @@ template <class T, class Allocator, class Predicate>
#include <__availability>
#include <__config>
#include <__format/enable_insertable.h>
+#include <__fwd/deque.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
@@ -244,9 +245,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Allocator = allocator<_Tp> >
-class _LIBCPP_TEMPLATE_VIS deque;
-
template <class _ValueType, class _DiffType>
struct __deque_block_size {
static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
diff --git a/libcxx/include/format b/libcxx/include/format
index 146613464534f7..f1e87de0f83015 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -223,6 +223,8 @@ namespace std {
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <locale>
+# include <queue>
+# include <stack>
#endif
#endif // _LIBCPP_FORMAT
diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd
index f1c2cbd9669679..9af5e05031850d 100644
--- a/libcxx/include/iosfwd
+++ b/libcxx/include/iosfwd
@@ -110,6 +110,7 @@ using wosyncstream = basic_osyncstream<wchar_t>; // C++20
#include <__fwd/fstream.h>
#include <__fwd/ios.h>
#include <__fwd/istream.h>
+#include <__fwd/memory.h>
#include <__fwd/ostream.h>
#include <__fwd/sstream.h>
#include <__fwd/streambuf.h>
@@ -162,10 +163,6 @@ using wosyncstream = basic_osyncstream<wchar_t>;
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
-// Include other forward declarations here
-template <class _Tp, class _Alloc = allocator<_Tp> >
-class _LIBCPP_TEMPLATE_VIS vector;
-
template <class _CharT, class _Traits>
class __save_flags {
typedef basic_ios<_CharT, _Traits> __stream_type;
diff --git a/libcxx/include/libcxx.imp b/libcxx/include/libcxx.imp
index 77b7befd44f56c..8c0da7ba575e46 100644
--- a/libcxx/include/libcxx.imp
+++ b/libcxx/include/libcxx.imp
@@ -424,22 +424,27 @@
{ include: [ "<__fwd/bit_reference.h>", "private", "<bitset>", "public" ] },
{ include: [ "<__fwd/bit_reference.h>", "private", "<vector>", "public" ] },
{ include: [ "<__fwd/complex.h>", "private", "<complex>", "public" ] },
+ { include: [ "<__fwd/deque.h>", "private", "<deque>", "public" ] },
{ include: [ "<__fwd/format.h>", "private", "<format>", "public" ] },
{ include: [ "<__fwd/fstream.h>", "private", "<iosfwd>", "public" ] },
{ include: [ "<__fwd/functional.h>", "private", "<functional>", "public" ] },
{ include: [ "<__fwd/ios.h>", "private", "<iosfwd>", "public" ] },
{ include: [ "<__fwd/istream.h>", "private", "<iosfwd>", "public" ] },
{ include: [ "<__fwd/mdspan.h>", "private", "<mdspan>", "public" ] },
+ { include: [ "<__fwd/memory.h>", "private", "<memory>", "public" ] },
{ include: [ "<__fwd/memory_resource.h>", "private", "<memory_resource>", "public" ] },
{ include: [ "<__fwd/ostream.h>", "private", "<iosfwd>", "public" ] },
{ include: [ "<__fwd/pair.h>", "private", "<utility>", "public" ] },
+ { include: [ "<__fwd/queue.h>", "private", "<queue>", "public" ] },
{ include: [ "<__fwd/span.h>", "private", "<span>", "public" ] },
{ include: [ "<__fwd/sstream.h>", "private", "<iosfwd>", "public" ] },
+ { include: [ "<__fwd/stack.h>", "private", "<stack>", "public" ] },
{ include: [ "<__fwd/streambuf.h>", "private", "<iosfwd>", "public" ] },
{ include: [ "<__fwd/string.h>", "private", "<string>", "public" ] },
{ include: [ "<__fwd/string_view.h>", "private", "<string_view>", "public" ] },
{ include: [ "<__fwd/subrange.h>", "private", "<ranges>", "public" ] },
{ include: [ "<__fwd/tuple.h>", "private", "<tuple>", "public" ] },
+ { include: [ "<__fwd/vector.h>", "private", "<vector>", "public" ] },
{ include: [ "<__ios/fpos.h>", "private", "<ios>", "public" ] },
{ include: [ "<__iterator/access.h>", "private", "<iterator>", "public" ] },
{ include: [ "<__iterator/advance.h>", "private", "<iterator>", "public" ] },
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index f36a47cef00977..b4a7256f3692fa 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1251,6 +1251,8 @@ module std_private_debug_utils_strict_weak_ordering_check [system] {
export std_private_type_traits_is_constant_evaluated
}
+module std_private_deque_fwd [system] { header "__fwd/deque.h" }
+
module std_private_exception_exception [system] { header "__exception/exception.h" }
module std_private_exception_exception_ptr [system] {
header "__exception/exception_ptr.h"
@@ -1531,6 +1533,7 @@ module std_private_memory_concepts [system] {
}
module std_private_memory_construct_at [system] { header "__memory/construct_at.h" }
module std_private_memory_destruct_n [system] { header "__memory/destruct_n.h" }
+module std_private_memory_fwd [system] { header "__fwd/memory.h" }
module std_private_memory_pointer_traits [system] { header "__memory/pointer_traits.h" }
module std_private_memory_ranges_construct_at [system] { header "__memory/ranges_construct_at.h" }
module std_private_memory_ranges_uninitialized_algorithms [system] {
@@ -1596,6 +1599,8 @@ module std_private_numeric_transform_exclusive_scan [system] { header "__numeric
module std_private_numeric_transform_inclusive_scan [system] { header "__numeric/transform_inclusive_scan.h" }
module std_private_numeric_transform_reduce [system] { header "__numeric/transform_reduce.h" }
+module std_private_queue_fwd [system] { header "__fwd/queue.h" }
+
module std_private_random_bernoulli_distribution [system] { header "__random/bernoulli_distribution.h" }
module std_private_random_binomial_distribution [system] { header "__random/binomial_distribution.h" }
module std_private_random_cauchy_distribution [system] { header "__random/cauchy_distribution.h" }
@@ -1733,6 +1738,8 @@ module std_private_ranges_zip_view [system] { header "__ranges
module std_private_span_span_fwd [system] { header "__fwd/span.h" }
+module std_private_stack_fwd [system] { header "__fwd/stack.h" }
+
module std_private_stop_token_atomic_unique_lock [system] { header "__stop_token/atomic_unique_lock.h" }
module std_private_stop_token_intrusive_list_view [system] { header "__stop_token/intrusive_list_view.h" }
module std_private_stop_token_intrusive_shared_ptr [system] { header "__stop_token/intrusive_shared_ptr.h" }
@@ -2081,3 +2088,5 @@ module std_private_utility_to_underlying [system] { header "__utility/t
module std_private_utility_unreachable [system] { header "__utility/unreachable.h" }
module std_private_variant_monostate [system] { header "__variant/monostate.h" }
+
+module std_private_vector_fwd [system] { header "__fwd/vector.h" }
diff --git a/libcxx/include/queue b/libcxx/include/queue
index 521a465713cd22..f94cd7671863fd 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -260,6 +260,8 @@ template <class T, class Container, class Compare>
#include <__algorithm/ranges_copy.h>
#include <__config>
#include <__functional/operations.h>
+#include <__fwd/deque.h>
+#include <__fwd/queue.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
@@ -287,9 +289,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container = deque<_Tp> >
-class _LIBCPP_TEMPLATE_VIS queue;
-
template <class _Tp, class _Container>
_LIBCPP_HIDE_FROM_ABI bool operator==(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y);
@@ -511,7 +510,7 @@ template <class _Tp, class _Container, class _Alloc>
struct _LIBCPP_TEMPLATE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc> : public uses_allocator<_Container, _Alloc> {
};
-template <class _Tp, class _Container = vector<_Tp>, class _Compare = less<typename _Container::value_type> >
+template <class _Tp, class _Container, class _Compare>
class _LIBCPP_TEMPLATE_VIS priority_queue {
public:
typedef _Container container_type;
diff --git a/libcxx/include/stack b/libcxx/include/stack
index 4003792600a004..08a392da6848dd 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -115,6 +115,7 @@ template <class T, class Container>
#include <__algorithm/ranges_copy.h>
#include <__config>
+#include <__fwd/stack.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
@@ -142,9 +143,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container = deque<_Tp> >
-class _LIBCPP_TEMPLATE_VIS stack;
-
template <class _Tp, class _Container>
_LIBCPP_HIDE_FROM_ABI bool operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
diff --git a/libcxx/include/vector b/libcxx/include/vector
index 0908482600c533..1defc43a52478b 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -325,6 +325,7 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
#include <__format/formatter_bool.h>
#include <__functional/hash.h>
#include <__functional/unary_function.h>
+#include <__fwd/vector.h>
#include <__iterator/advance.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
@@ -357,7 +358,6 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
#include <__utility/swap.h>
#include <climits>
#include <cstring>
-#include <iosfwd> // for forward declaration of vector
#include <limits>
#include <stdexcept>
#include <version>
@@ -2989,6 +2989,7 @@ _LIBCPP_POP_MACROS
# include <atomic>
# include <concepts>
# include <cstdlib>
+# include <iosfwd>
# include <locale>
# include <tuple>
# include <type_traits>
diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv
index c65b9b9d705e27..2e246644f626cc 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx03.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv
@@ -267,6 +267,7 @@ filesystem type_traits
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv
index b3d9e327fc7aa9..e074bf1f7dcc8d 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -268,6 +268,7 @@ filesystem type_traits
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv
index d723409422a3eb..88f9c24f086462 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -270,6 +270,7 @@ filesystem type_traits
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv
index d723409422a3eb..88f9c24f086462 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -270,6 +270,7 @@ filesystem type_traits
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv
index 03b4eda8b4d868..27f59660fb98dc 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -281,6 +281,7 @@ filesystem type_traits
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx23.csv b/libcxx/test/libcxx/transitive_includes/cxx23.csv
index 8150f0935900e4..e89e8b92d84297 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx23.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx23.csv
@@ -192,6 +192,7 @@ filesystem string_view
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
@@ -203,8 +204,6 @@ format initializer_list
format limits
format new
format optional
-format queue
-format stack
format stdexcept
format string
format string_view
@@ -682,7 +681,6 @@ vector cstdlib
vector cstring
vector cwchar
vector initializer_list
-vector iosfwd
vector limits
vector new
vector stdexcept
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 8150f0935900e4..e89e8b92d84297 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -192,6 +192,7 @@ filesystem string_view
filesystem version
format array
format cctype
+format cerrno
format clocale
format cmath
format cstddef
@@ -203,8 +204,6 @@ format initializer_list
format limits
format new
format optional
-format queue
-format stack
format stdexcept
format string
format string_view
@@ -682,7 +681,6 @@ vector cstdlib
vector cstring
vector cwchar
vector initializer_list
-vector iosfwd
vector limits
vector new
vector stdexcept
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.verify.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.verify.cpp
index 7ce00d70f8442b..2b2242e240a2cd 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.verify.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.verify.cpp
@@ -14,25 +14,20 @@
// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-#include <deque>
-#include <iterator>
#include <cassert>
#include <cstddef>
-
-
-int main(int, char**)
-{
-// Test the explicit deduction guides
-
-// Test the implicit deduction guides
- {
-// vector (allocator &)
- std::vector vec((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'vector'}}
-// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
-// Also, we can't use {} instead of parens, because that constructs a
-// deque<allocator<int>, allocator<allocator<int>>>
- }
-
+#include <vector>
+
+int main(int, char**) {
+ // Test the explicit deduction guides
+ // TODO: Should there be tests for explicit deduction guides?
+
+ // Test the implicit deduction guides
+ {
+ // vector (allocator &)
+ // expected-error at +1 {{no viable constructor or deduction guide for deduction of template arguments of 'vector'}}
+ std::vector vec(std::allocator< int>{});
+ }
return 0;
}
diff --git a/libcxx/test/support/deduction_guides_sfinae_checks.h b/libcxx/test/support/deduction_guides_sfinae_checks.h
index 8b715da5a34e25..0c32b3732413a9 100644
--- a/libcxx/test/support/deduction_guides_sfinae_checks.h
+++ b/libcxx/test/support/deduction_guides_sfinae_checks.h
@@ -16,6 +16,7 @@
#include <memory>
#include <type_traits>
#include <utility>
+#include <vector>
#include "test_macros.h"
#if TEST_STD_VER >= 23
More information about the libcxx-commits
mailing list