[libcxx-commits] [PATCH] D119281: [libc++] Use [[no_unique_address]] in __alloc_func

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 8 13:55:23 PST 2022


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

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]]`.



================
Comment at: libcxx/include/__functional/function.h:137
+    _Fp __func;
+    [[no_unique_address]] _Ap __alloc;
 
----------------
Does Clang really support this in earlier standards?


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