[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 Jan 24 03:56:54 PST 2023


AdvenamTacet added inline comments.


================
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.");
----------------
philnik wrote:
> 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.
Should I change it? I see that you accepted the revision.


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