[libcxx-commits] [libcxx] [libc++] Ensure that `std::expected` has no tail padding (PR #69673)
Richard Smith via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 20 11:21:40 PDT 2023
Jan =?utf-8?q?Kokemüller?= <jan.kokemueller at gmail.com>,
Jan =?utf-8?q?Kokemüller?= <jan.kokemueller at gmail.com>,
Jan =?utf-8?q?Kokemüller?= <jan.kokemueller at gmail.com>,
Jan =?utf-8?q?Kokemüller?= <jan.kokemueller at gmail.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/69673/libcxx at github.com>
https://github.com/zygoloid commented:
I don't think that filling in the tail padding is sufficient here. Once we fix Clang to properly implement the "transparent replacement" rule for `std::construct_at`, constant evaluation of `expected::emplace` is going to stop working, and this change doesn't help there.
If you don't want to rely on a language extension, the rule you need to conform to is that you can't transparently replace a potentially overlapping subboject -- you can't use `construct_at` on a base class or a `[[no_unique_address]]` member.
https://github.com/llvm/llvm-project/pull/69673
More information about the libcxx-commits
mailing list