[llvm-branch-commits] [libcxx] release/20.x: [libcxx] Add a missing include for __bit_iterator (#127015) (PR #131382)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 14 12:38:59 PDT 2025


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/131382

Backport 672e385

Requested by: @ian-twilightcoder

>From 5c899c9694bf13e48f5959feb4189540f56328b9 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Thu, 13 Feb 2025 16:54:43 +0900
Subject: [PATCH] [libcxx] Add a missing include for __bit_iterator (#127015)

This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__vector/vector_bool.h:85:11: error: default argument of '__bit_iterator' must be imported from module 'std.bit_reference_fwd' before it is required
   85 |   typedef __bit_iterator<vector, false> pointer;
      |           ^
../../third_party/libc++/src/include/__fwd/bit_reference.h:23:68: note: default argument declared here is not reachable
   23 | template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0>
      |                                                                    ^
```

(cherry picked from commit 672e3858a4e4b9e155adb72426074ea2af0dd922)
---
 libcxx/include/__vector/vector_bool.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxx/include/__vector/vector_bool.h b/libcxx/include/__vector/vector_bool.h
index 4f1c442ce0be8..feff646a35dc8 100644
--- a/libcxx/include/__vector/vector_bool.h
+++ b/libcxx/include/__vector/vector_bool.h
@@ -17,6 +17,7 @@
 #include <__bit_reference>
 #include <__config>
 #include <__functional/unary_function.h>
+#include <__fwd/bit_reference.h>
 #include <__fwd/functional.h>
 #include <__fwd/vector.h>
 #include <__iterator/distance.h>



More information about the llvm-branch-commits mailing list