[libcxx-commits] [PATCH] D119281: [libc++] Use [[no_unique_address]] in __alloc_func
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 8 14:35:29 PST 2022
philnik abandoned this revision.
philnik added a comment.
In D119281#3306015 <https://reviews.llvm.org/D119281#3306015>, @ldionne wrote:
> Unfortunately, we can't make this change because it breaks the ABI. We can't modify the layout of `__alloc_func` because existing programs could have inlined assumptions about its layout.
>
> The layout changes notably for empty classes that are final -- those won't be elided with `__compressed_pair`, but they will with `[[no_unique_address]]`.
That really is unfortunate.
================
Comment at: libcxx/include/__functional/function.h:137
+ _Fp __func;
+ [[no_unique_address]] _Ap __alloc;
----------------
ldionne wrote:
> Does Clang really support this in earlier standards?
Yes! https://godbolt.org/z/W9c3erW59
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119281/new/
https://reviews.llvm.org/D119281
More information about the libcxx-commits
mailing list