Skip to content

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Oct 8, 2025

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.

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.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner October 8, 2025 16:19
@frederick-vs-ja frederick-vs-ja added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-libcxx

Author: A. Jiang (frederick-vs-ja)

Changes

Currently, size_t and __libcpp_is_constant_evaluated are obtained by transitive inclusion in &lt;__algorithm/find.h&gt; when &lt;cwchar&gt; 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.


Full diff: https://github.com/llvm/llvm-project/pull/162508.diff

1 Files Affected:

  • (modified) libcxx/include/__algorithm/find.h (+2)
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>

@philnik777
Copy link
Contributor

Do you have a link to the CI failure?

@frederick-vs-ja
Copy link
Contributor Author

Do you have a link to the CI failure?

Yes. E.g.

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid the link in the commit message. GH CI links aren't stable.

@frederick-vs-ja
Copy link
Contributor Author

The link is removed from the PR message now.

@frederick-vs-ja frederick-vs-ja merged commit d6d5026 into llvm:main Oct 9, 2025
75 of 77 checks passed
@frederick-vs-ja frederick-vs-ja deleted the algorithm-find-include branch October 9, 2025 09:58
svkeerthy pushed a commit that referenced this pull request Oct 9, 2025
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.
clingfei pushed a commit to clingfei/llvm-project that referenced this pull request Oct 10, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants