[libcxx-commits] [PATCH] D145628: [ASan][libcxx] A way to turn off annotations for containers with a specific allocator

Tacet via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 27 04:03:00 PDT 2023


AdvenamTacet added inline comments.


================
Comment at: libcxx/include/__memory/allocator_traits.h:407-414
+struct __asan_annotate_container_with_allocator {
+#   if _LIBCPP_CLANG_VER >= 1600
+      static bool const value = true;
+#   else
+      // TODO LLVM18: Remove the special-casing
+      static bool const value = std::is_same<_Alloc, std::allocator<_Alloc::value_type> >::value;
+#   endif
----------------
philnik wrote:
> IMO we should require this to be a Cpp17UnaryTypeTrait.
@phillnik does it work with C++03? It will be used inside std::vector etc. so it should work with every supported standard.

It's nice to suggest it in `libcxx/docs/UsingLibcxx.rst`, but I don't think we can use it here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145628



More information about the libcxx-commits mailing list