[libcxx-commits] [libcxx] [libc++] Fix UB in <expected> related to "has value" flag (#68552) (PR #68733)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Oct 14 15:37:24 PDT 2023
philnik777 wrote:
> This is a simplified example. https://godbolt.org/z/YGbG3PeYY
>
> I don't think we can fix it. It is a mistake to use `[[no_unique_address]]` I think. I think there is no way to fix without breaking ABI now.
I think I agree. It's probably still early enough to fix the ABI (especially given that these bugs are pretty severe). In LLVM 16 C++23 features were still experimental and we can backport this to LLVM 17. @ldionne do you agree? Should we add an ABI tag? Is this severe enough to warrant a 17.1 release? (CC @tru @tstellar)
I think we can still put at least `__has_val_` into the padding bits, since we control that. It should be good enough to add a `char __padding_[sizeof(expected) - __libcpp_datasizeof<expected>::value];` to avoid accidental overwrites of user data.
https://github.com/llvm/llvm-project/pull/68733
More information about the libcxx-commits
mailing list