[libcxx-commits] [PATCH] D122598: [libcxx] avoid using anonymous struct with base classes (fixes gcc-12)

Azat Khuzhin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 4 23:53:21 PDT 2022


azat added inline comments.


================
Comment at: libcxx/include/string:690
         value_type __data_[__min_cap];
-        struct
-            : __padding<value_type>
-        {
-            unsigned char __size_;
-        };
+        char __padding[sizeof(value_type) - 1];
+        unsigned char __size_;
----------------
ldionne wrote:
> This should be `unsigned char __padding[...]`. It doesn't change anything, but it makes it clearer that we're padding the `unsigned char __size_` member that follows.
So I should made this change once https://reviews.llvm.org/D123081 will land, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122598



More information about the libcxx-commits mailing list