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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 22 00:56:22 PDT 2022

philnik added inline comments.

Comment at: libcxx/include/string:724
-    struct __long
+    struct __long_impl
hubert.reinterpretcast wrote:
> philnik wrote:
> > How exactly is this different from using `__atrribute__((__packed__))`? If it's not I would suggest to put `__is_long_` and `__cap_` into it's own struct and mark only that as `__attribute__((__packed__))`to avoid the explicit padding and `alignas()` specifiers.
> That should work. Any preference between base class, anonymous struct, or named member?
> The named member version is the most pragmatic (does not change whether the type is standard layout, does not use language extension).
I think an anonymous struct would be the best option. That makes it almost identical to the current version, so there wouldn't have to be any code changes elsewhere.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list