diff options
author | Marek Kurdej <marek.kurdej+llvm.org@gmail.com> | 2023-09-26 12:54:16 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2023-10-05 09:11:49 -0400 |
commit | d2cb198f25c82bf77bb113763771590cc79a21a4 (patch) | |
tree | bcf54c01374cb099ab5b4f779b84373d05c3417e /libcxx/src | |
parent | 2c49311dead19a274a3ce2d422c75264ecd160d2 (diff) | |
download | llvm-d2cb198f25c82bf77bb113763771590cc79a21a4.zip llvm-d2cb198f25c82bf77bb113763771590cc79a21a4.tar.gz llvm-d2cb198f25c82bf77bb113763771590cc79a21a4.tar.bz2 |
[libc++] Make future_error constructor standard-compliant
This patch removes the non compliant constructor of std::future_error
and adds the standards compliant constructor in C++17 instead.
Note that we can't support the constructor as an extension in all
standard modes because it uses delegating constructors, which require
C++11. We could in theory support the constructor as an extension in
C++11 and C++14 only, however I believe it is acceptable not to do that
since I expect the breakage from this patch will be minimal.
If it turns out that more code than we expect is broken by this, we can
reconsider that decision.
This was found during D99515.
Differential Revision: https://reviews.llvm.org/D99567
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/future.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp index fa1004e..3383b50 100644 --- a/libcxx/src/future.cpp +++ b/libcxx/src/future.cpp @@ -204,9 +204,7 @@ promise<void>::~promise() { #ifndef _LIBCPP_HAS_NO_EXCEPTIONS if (!__state_->__has_value() && __state_->use_count() > 1) - __state_->set_exception(make_exception_ptr( - future_error(make_error_code(future_errc::broken_promise)) - )); + __state_->set_exception(make_exception_ptr(future_error(future_errc::broken_promise))); #endif // _LIBCPP_HAS_NO_EXCEPTIONS __state_->__release_shared(); } |