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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 22 08:40:26 PDT 2022


Mordante added a comment.

Thanks for working on this!

The build failure is unrelated, can you rebase before reuploading this patch?



================
Comment at: libcxx/include/string:726
     {
-        size_type __is_long_ : 1;
-        size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;
+        struct _LIBCPP_PACKED {
+            size_type __is_long_ : 1;
----------------
Please add a comment explaining why we packed is needed.
(I understand it, but over a year I will scratch my head.)


================
Comment at: libcxx/include/string:749
 
     static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size.");
 
----------------
Does `__long` have a fixed size too? If so can add a `static_assert` for it too?


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