[libcxx-commits] [libcxx] [libc++] Ensure that `std::expected` has no tail padding (PR #69673)

Jan Kokemüller via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 20 11:03:44 PDT 2023


================
@@ -955,8 +956,17 @@ class expected {
     _LIBCPP_NO_UNIQUE_ADDRESS _ErrorType __unex_;
   };
 
+  _LIBCPP_HIDE_FROM_ABI static constexpr auto __calculate_padding() {
----------------
jiixyj wrote:

I implemented an alternative approach to calculate the padding type that avoids zero-length arrays (still wondering if there is a more elegant way, though). I also added some tests.

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


More information about the libcxx-commits mailing list