[libcxx-commits] [libcxx] [libc++] Avoid transitive inclusion for `<__algorithm/find.h>` (PR #162508)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 8 09:19:26 PDT 2025


https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/162508

Currently, `size_t` and `__libcpp_is_constant_evaluated` are obtained by transitive inclusion in `<__algorithm/find.h>` when `<cwchar>` is not included. This broke module build when `_LIBCPP_HAS_WIDE_CHARACTERS` is `1` and caused CI failure. We should explicitly include the corresponding internal headers.

>From 3cee23d51f6032bc3e5d71124ec9f09b4060b25b Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Thu, 9 Oct 2025 00:09:00 +0800
Subject: [PATCH] [libc++] Avoid transitive inclusion for
 `<__algorithm/find.h>`

Currently, `size_t` and `__libcpp_is_constant_evaluated` are obtained by
transitive inclusion in `<__algorithm/find.h>` when `<cwchar>` is not
included. This broke module build when `_LIBCPP_HAS_WIDE_CHARACTERS` is
`1` and caused CI failure. We should explicitly include the
corresponding internal headers.
---
 libcxx/include/__algorithm/find.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libcxx/include/__algorithm/find.h b/libcxx/include/__algorithm/find.h
index 72e201a3c693b..10379d7074c3a 100644
--- a/libcxx/include/__algorithm/find.h
+++ b/libcxx/include/__algorithm/find.h
@@ -17,12 +17,14 @@
 #include <__bit/countr.h>
 #include <__bit/invert_if.h>
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__functional/identity.h>
 #include <__fwd/bit_reference.h>
 #include <__iterator/segmented_iterator.h>
 #include <__string/constexpr_c_functions.h>
 #include <__type_traits/enable_if.h>
 #include <__type_traits/invoke.h>
+#include <__type_traits/is_constant_evaluated.h>
 #include <__type_traits/is_equality_comparable.h>
 #include <__type_traits/is_integral.h>
 #include <__type_traits/is_signed.h>



More information about the libcxx-commits mailing list