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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 27 04:06:26 PDT 2023


philnik 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
----------------
AdvenamTacet wrote:
> 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.
Yes, it works in our C++03. We have lots of extensions there (it's basically anything that can be implemented in C++03 with clang extensions that was added in C++11).


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