Make it possible to build a no-exceptions variant of libcxx.
Fixes a small omission in libcxx that prevents libcxx being built when
-DLIBCXX_ENABLE_EXCEPTIONS=0 is specified.
This patch adds XFAILS to all those tests that are currently failing
on the new -fno-exceptions library variant. Follow-up patches will
update the tests (progressively) to cope with the new library variant.
Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a
llvm-svn: 252598
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: f520c1445f2d9cfb6153e3c125076aa6e3a76fc8
diff --git a/src/future.cpp b/src/future.cpp
index 3132b18..e1758f3 100644
--- a/src/future.cpp
+++ b/src/future.cpp
@@ -221,10 +221,12 @@
{
if (__state_)
{
+#ifndef _LIBCPP_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))
));
+#endif // _LIBCPP_NO_EXCEPTIONS
__state_->__release_shared();
}
}