[libcxx-commits] [libcxx] 2ca101f - [libc++][test] Fix `MaybePOCCAAllocator` to finally meet the allocator requirements (#74960)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Dec 10 05:19:59 PST 2023


Author: Stephan T. Lavavej
Date: 2023-12-10T05:19:55-08:00
New Revision: 2ca101f4b019adafe5fe3545420eaec160bd6e79

URL: https://github.com/llvm/llvm-project/commit/2ca101f4b019adafe5fe3545420eaec160bd6e79
DIFF: https://github.com/llvm/llvm-project/commit/2ca101f4b019adafe5fe3545420eaec160bd6e79.diff

LOG: [libc++][test] Fix `MaybePOCCAAllocator` to finally meet the allocator requirements (#74960)

Found while running libc++'s test suite with MSVC's STL.

After @CaseyCarter's [LLVM-D118279](https://reviews.llvm.org/D118279)
https://github.com/llvm/llvm-project/commit/c5ba46ea1804dfefb22e6d2bb65ff1636d2cc8cd
"\[libcxx\]\[test\] `MaybePOCCAAllocator` should meet the
*Cpp17Allocator* requirements" followed by @philnik777's
[LLVM-D68365](https://reviews.llvm.org/D68365)
https://github.com/llvm/llvm-project/commit/98d3d5b5da66e3cf7807c23a0294280bb796466b
"\[libc++\] Implement [P1004R2](https://wg21.link/P1004R2) (`constexpr
std::vector`)", one more change is necessary.

MSVC's `constexpr vector` implementation noticed this because we always
rebind allocators.

Added: 
    

Modified: 
    libcxx/test/support/allocators.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h
index 2b987ad872783e..02436fd9c35ef1 100644
--- a/libcxx/test/support/allocators.h
+++ b/libcxx/test/support/allocators.h
@@ -209,7 +209,7 @@ class MaybePOCCAAllocator {
         : id_(id), copy_assigned_into_(copy_assigned_into) {}
 
     template <class U>
-    MaybePOCCAAllocator(const MaybePOCCAAllocator<U, POCCAValue>& that)
+    TEST_CONSTEXPR MaybePOCCAAllocator(const MaybePOCCAAllocator<U, POCCAValue>& that)
         : id_(that.id_), copy_assigned_into_(that.copy_assigned_into_) {}
 
     MaybePOCCAAllocator(const MaybePOCCAAllocator&) = default;


        


More information about the libcxx-commits mailing list