[libcxx-commits] [PATCH] D128285: [libc++][AIX] Make basic_string layout compatible with earlier version

Xing Xue via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 24 11:11:44 PDT 2022


xingxue marked an inline comment as done.
xingxue added inline comments.


================
Comment at: libcxx/include/string:759
 
+    static_assert(sizeof(__long) == (sizeof(pointer) + sizeof(size_type) * 2), "__long has an unexpected size.");
     static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size.");
----------------
hubert.reinterpretcast wrote:
> This assumes that `pointer` is not a type (maybe some sort of fancy smart pointer) that has a higher alignment requirement than `sizeof(size_type) * 2`.
Good point, thanks!  Modified the assert to take padding into account.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128285



More information about the libcxx-commits mailing list