summaryrefslogtreecommitdiff
path: root/test/std/experimental/optional/optional.specalg
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/experimental/optional/optional.specalg')
-rw-r--r--test/std/experimental/optional/optional.specalg/make_optional.pass.cpp7
-rw-r--r--test/std/experimental/optional/optional.specalg/swap.pass.cpp8
2 files changed, 5 insertions, 10 deletions
diff --git a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp b/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
index cc95e6110e8d7..9abd87bd40513 100644
--- a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
+++ b/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
// <optional>
// template <class T>
@@ -19,9 +20,10 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
using std::experimental::optional;
using std::experimental::make_optional;
@@ -38,7 +40,7 @@ int main()
std::string s("123");
optional<std::string> opt = make_optional(std::move(s));
assert(*opt == "123");
- assert(s.empty());
+ LIBCPP_ASSERT(s.empty());
}
{
std::unique_ptr<int> s(new int(3));
@@ -46,5 +48,4 @@ int main()
assert(**opt == 3);
assert(s == nullptr);
}
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
index 6c5f7b0e860c1..d339c53c1f771 100644
--- a/test/std/experimental/optional/optional.specalg/swap.pass.cpp
+++ b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
// XFAIL: libcpp-no-exceptions
// <optional>
@@ -17,8 +18,6 @@
#include <type_traits>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
using std::experimental::optional;
class X
@@ -62,12 +61,8 @@ public:
friend void swap(Z& x, Z& y) {throw 6;}
};
-
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
{
optional<int> opt1;
optional<int> opt2;
@@ -302,5 +297,4 @@ int main()
assert(static_cast<bool>(opt2) == true);
assert(*opt2 == 2);
}
-#endif // _LIBCPP_STD_VER > 11
}