[libcxx-commits] [libcxx] [libcxx] fixes `__split_buffer_size_layout` bugs (PR #178341)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 28 11:07:35 PST 2026


================
@@ -312,10 +304,8 @@ public:
     return __begin_[__size_ - 1];
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(
-      __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type, __split_buffer_pointer_layout>,
-                                    value_type,
-                                    allocator_type>& __other) _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
+  __swap_without_allocator(__split_buffer_size_layout& __other) _NOEXCEPT {
----------------
ldionne wrote:

I do think that the explicit `static_cast<__base_type&>` at the call site in `__split_buffer` is helpful to make it more explicit what types we're passing. When I initially looked into this issue, I got really confused about what we were supposed to pass and what we were actually passing.

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


More information about the libcxx-commits mailing list