[libcxx-commits] [libcxx] [libc++] Add an ABI flag to make __bit_iterator trivially copyable (PR #172271)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 15 02:10:30 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions ,h -- libcxx/include/__bit_reference libcxx/include/__configuration/abi.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 4a96dd468..c7722a23c 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -319,7 +319,8 @@ public:
 #endif
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
       : __seg_(__it.__seg_),
-        __ctz_(__it.__ctz_) {}
+        __ctz_(__it.__ctz_) {
+  }
 
 #ifndef _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
   // When _IsConst=false, we have a user-provided copy constructor,
@@ -334,7 +335,7 @@ public:
     return *this;
   }
 #else
-  __bit_iterator(const __bit_iterator&) = default;
+  __bit_iterator(const __bit_iterator&)            = default;
   __bit_iterator& operator=(const __bit_iterator&) = default;
 #endif // _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/172271


More information about the libcxx-commits mailing list