summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-17 20:32:30 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-17 20:32:30 +0000
commit649da70defac4ce1f2236cec03d0710cfccaac12 (patch)
tree9d027be4bf30c7969004adcc9948ccf529a4c37e /libcxx/test/std/experimental
parent5d4102417b654ce0ed447923d02d7d706ab80165 (diff)
downloadbcm5719-llvm-649da70defac4ce1f2236cec03d0710cfccaac12.tar.gz
bcm5719-llvm-649da70defac4ce1f2236cec03d0710cfccaac12.zip
Fix std::experimental::optional tests. Patch from Casey Carter.
llvm-svn: 275732
Diffstat (limited to 'libcxx/test/std/experimental')
-rw-r--r--libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp2
-rw-r--r--libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp12
-rw-r--r--libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp4
-rw-r--r--libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp2
-rw-r--r--libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp2
5 files changed, 9 insertions, 13 deletions
diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index bb8fcd5a7ce..fec37408e43 100644
--- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -59,7 +59,7 @@ public:
static bool dtor_called;
constexpr Z() : i_(0) {}
constexpr Z(int i) : i_(i) {}
- constexpr Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
+ Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
{throw 6;}
~Z() {dtor_called = true;}
diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
index acc139ed9b5..9bd6b18989f 100644
--- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
+++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
@@ -59,7 +59,7 @@ class Z
public:
constexpr Z() : i_(0) {}
constexpr Z(int i) : i_(i) {}
- constexpr Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
+ Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
{throw 6;}
friend constexpr bool operator==(const Z& x, const Z& y)
@@ -97,6 +97,8 @@ int main()
: optional<Y>(in_place, i) {}
};
+ constexpr test_constexpr_ctor dopt(in_place, {42, 101, -1});
+ static_assert(*dopt == Y{42, 101, -1}, "");
}
{
static_assert(std::is_constructible<optional<Z>, std::initializer_list<int>&>::value, "");
@@ -109,13 +111,5 @@ int main()
{
assert(i == 6);
}
-
- struct test_constexpr_ctor
- : public optional<Z>
- {
- constexpr test_constexpr_ctor(in_place_t, std::initializer_list<int> i)
- : optional<Z>(in_place, i) {}
- };
-
}
}
diff --git a/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp b/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
index 7f5ffea6fa7..9abd87bd405 100644
--- a/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
+++ b/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
@@ -20,6 +20,8 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
using std::experimental::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));
diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp
index fb695d29820..89c207306ab 100644
--- a/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp
+++ b/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp
@@ -11,7 +11,7 @@
// <optional>
// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) null_opt_t is ill-formed.
+// (possibly cv-qualified) nullopt_t is ill-formed.
#include <experimental/optional>
diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp
index 9b62c9b3994..3d276d64202 100644
--- a/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp
+++ b/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp
@@ -11,7 +11,7 @@
// <optional>
// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) null_opt_t is ill-formed.
+// (possibly cv-qualified) nullopt_t is ill-formed.
#include <experimental/optional>
OpenPOWER on IntegriCloud