[libcxx-commits] [libcxx] [libc++] Fix UB in <expected> related to "has value" flag (#68552) (PR #68733)

Jan Kokemüller via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 17 11:28:36 PDT 2023


================
@@ -899,6 +860,14 @@ class expected {
   union __union_t {
     _LIBCPP_HIDE_FROM_ABI constexpr __union_t() {}
----------------
jiixyj wrote:

Good catch! I could even remove the whole `__empty_t` struct from the non-`void` `expected` union now that it always is constructed in the member initializer lists of the `expected` constructors.

https://github.com/llvm/llvm-project/pull/68733


More information about the libcxx-commits mailing list