[libcxx-commits] [libcxx] [libc++] Ues _LIBCPP_NO_UNIQUE_ADDRESS for the new vetor layout (PR #207149)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 2 02:34:53 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>

We use `_LIBCPP_NO_UNIQUE_ADDRESS`, since a plain `[[no_unique_address]]` doesn't work on Windows.


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


1 Files Affected:

- (modified) libcxx/include/__vector/layout.h (+1-1) 


``````````diff
diff --git a/libcxx/include/__vector/layout.h b/libcxx/include/__vector/layout.h
index 65d11aa238df0..910078b1e760e 100644
--- a/libcxx/include/__vector/layout.h
+++ b/libcxx/include/__vector/layout.h
@@ -217,7 +217,7 @@ class __vector_layout {
 #ifdef _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
   size_type __size_     = 0;
   size_type __capacity_ = 0;
-  [[no_unique_address]] allocator_type __alloc_;
+  _LIBCPP_NO_UNIQUE_ADDRESS allocator_type __alloc_;
 #else
   pointer __end_ = nullptr;
   _LIBCPP_COMPRESSED_PAIR(pointer, __capacity_ = nullptr, allocator_type, __alloc_);

``````````

</details>


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


More information about the libcxx-commits mailing list