summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp')
-rw-r--r--libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
index 6a7b56e588d..256396094a9 100644
--- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// template <class... Args> void optional<T>::emplace(Args&&... args);
@@ -18,6 +17,8 @@
#include <cassert>
#include <memory>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -48,7 +49,7 @@ class Z
public:
static bool dtor_called;
Z() = default;
- Z(int) {throw 6;}
+ Z(int) {TEST_THROW(6);}
~Z() {dtor_called = true;}
};
@@ -131,6 +132,7 @@ int main()
assert(Y::dtor_called == true);
}
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
Z z;
optional<Z> opt(z);
@@ -147,4 +149,5 @@ int main()
assert(Z::dtor_called == true);
}
}
+#endif
}
OpenPOWER on IntegriCloud