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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 23 22:29:15 PST 2023


philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.

LGTM % nit.



================
Comment at: libcxx/test/support/min_allocator.h:438-441
+#if _LIBCPP_STD_VER >= 11
+  static_assert(alignof(T) == 1, "Type T cannot be created on unaligned address (UB)");
+#else
+  static_assert(sizeof(T) == 1, "Creating an object of type T on unaligned address may be UB. In C++ older than C++11, only types with size 1 are accepted.");
----------------
Sorry that I didn't say that before. We have `TEST_ALIGNOF` to support C++03. Then you don't need the special-casing here.


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