[libcxx-commits] [libcxx] [libcxx] Add a missing include for __bit_iterator (PR #127015)

Takuto Ikuta via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 12 23:06:49 PST 2025


https://github.com/atetubou created https://github.com/llvm/llvm-project/pull/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>
      |                                                                    ^
```

>From 174ec8de1e2e712c1a1c571b5c87eedd4b70ec67 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Thu, 13 Feb 2025 16:06:24 +0900
Subject: [PATCH] [libcxx] Add a missing include for __bit_iterator

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>
      |                                                                    ^
```
---
 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 35f0f745e201c..714c86ae2bb96 100644
--- a/libcxx/include/__vector/vector_bool.h
+++ b/libcxx/include/__vector/vector_bool.h
@@ -18,6 +18,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 libcxx-commits mailing list