================ @@ -1150,12 +1150,15 @@ class expected<_Tp, _Err> { } _LIBCPP_HIDE_FROM_ABI constexpr void value() const& { + static_assert(is_copy_constructible_v<_Err>); if (!__has_val_) { std::__throw_bad_expected_access<_Err>(__union_.__unex_); } } _LIBCPP_HIDE_FROM_ABI constexpr void value() && { + static_assert(is_copy_constructible_v<_Err> && is_move_constructible_v<_Err>, + "error_type has to be both copy constructible and move constructible"); ---------------- PragmaTwice wrote:
done in 2614080a0e5260021a80140e5096bb86b46ebf23 https://github.com/llvm/llvm-project/pull/71819 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits