[libcxx-commits] [PATCH] D136765: [ASan][libcxx] Annotating std::vector with all allocators

Tacet via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 21 21:14:20 PST 2023


AdvenamTacet added inline comments.


================
Comment at: libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp:181
     }
+    // safe_allocator
+    {
----------------
philnik wrote:
> Could you make the allocator a template parameter instead to avoid the duplication? The other cases are small enough that I don't really care, but would of course be a plus to deduplicate them as well.
> Could you make the allocator a template parameter

I forgot to mention in the update note, I did that as well.


================
Comment at: libcxx/test/support/min_allocator.h:447
+
+  TEST_CONSTEXPR_CXX20 T* allocate(std::size_t n) { return static_cast<T*>(std::allocator<T>().allocate(n + 1)) + 1; }
+
----------------
philnik wrote:
> This `static_cast` shouldn't be necessary, right?
It's not, fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136765/new/

https://reviews.llvm.org/D136765



More information about the libcxx-commits mailing list