[libcxx-commits] [libcxx] [libc++] Annotate the data member of variant with no_unique_address (PR #137783)
Alex Aktsipetrov via libcxx-commits
libcxx-commits at lists.llvm.org
Sat May 3 05:52:09 PDT 2025
gizmondo wrote:
> I am not sure if you are aware of the bug that we had in std::expected, where we applied no_unique_address to the union.
Yeah I was aware of this issue. The current version of the PR is safe because the variant at the moment does not try to put the index in the tail padding of the user types. So what you're saying is that it _should_, and this ought to be implemented together with (conditionally) allowing users to reuse tail padding? The idea behind bundling it together is to not expand the zoo of potential variant layouts in the future, right?
https://github.com/llvm/llvm-project/pull/137783
More information about the libcxx-commits
mailing list