diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-09 19:53:08 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-09 19:53:08 +0000 |
commit | 8a597d653a9548424cc634909e18ec91b3ef6645 (patch) | |
tree | 2d5b242a58aad8d9b38f795f4a1778879a61cce4 /libcxx/test/std/utilities/tuple | |
parent | 23ae31cca0f681c9c948b53e557c53da2004f7dd (diff) | |
download | bcm5719-llvm-8a597d653a9548424cc634909e18ec91b3ef6645.tar.gz bcm5719-llvm-8a597d653a9548424cc634909e18ec91b3ef6645.zip |
[libcxx] [test] Add LIBCPP_ASSERT_NOEXCEPT/LIBCPP_ASSERT_NOT_NOEXCEPT, remove an unused variable.
test/support/test_macros.h
For convenience/greppability, add macros for libcxx-specific static_asserts about noexceptness.
(Moving the definitions of ASSERT_NOEXCEPT/ASSERT_NOT_NOEXCEPT isn't technically necessary
because they're macros, but I think it's better style to define stuff before using it.)
test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
There was a completely unused `TrackedCallable obj;`.
apply() isn't depicted with conditional noexcept in C++17.
test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
Now that we have LIBCPP_ASSERT_NOEXCEPT, use it.
Fixes D27622.
llvm-svn: 289264
Diffstat (limited to 'libcxx/test/std/utilities/tuple')
-rw-r--r-- | libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp | 5 | ||||
-rw-r--r-- | libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp index 2e821945d09..4c15499f5c1 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp @@ -166,7 +166,6 @@ void check_apply_quals_and_types(Tuple&& t) { void test_call_quals_and_arg_types() { - TrackedCallable obj; using Tup = std::tuple<int, int const&, unsigned&&>; const int x = 42; unsigned y = 101; @@ -199,7 +198,7 @@ void test_noexcept() // test that the functions noexcept-ness is propagated using Tup = std::tuple<int, const char*, long>; Tup t; - ASSERT_NOEXCEPT(std::apply(nec, t)); + LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, t)); ASSERT_NOT_NOEXCEPT(std::apply(tc, t)); } { @@ -207,7 +206,7 @@ void test_noexcept() using Tup = std::tuple<NothrowMoveable, int>; Tup t; ASSERT_NOT_NOEXCEPT(std::apply(nec, t)); - ASSERT_NOEXCEPT(std::apply(nec, std::move(t))); + LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, std::move(t))); } } diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp index 9ffd4c1594b..eee1dd88253 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp @@ -175,14 +175,14 @@ void test_noexcept() { Tuple tup; ((void)tup); Tuple const& ctup = tup; ((void)ctup); ASSERT_NOT_NOEXCEPT(std::make_from_tuple<TestType>(ctup)); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup))); } { using Tuple = std::pair<int, NothrowMoveable>; Tuple tup; ((void)tup); Tuple const& ctup = tup; ((void)ctup); ASSERT_NOT_NOEXCEPT(std::make_from_tuple<TestType>(ctup)); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup))); } { using Tuple = std::tuple<int, int, int>; @@ -192,7 +192,7 @@ void test_noexcept() { { using Tuple = std::tuple<long, long, long>; Tuple tup; ((void)tup); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup)); } { using Tuple = std::array<int, 3>; @@ -202,7 +202,7 @@ void test_noexcept() { { using Tuple = std::array<long, 3>; Tuple tup; ((void)tup); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup)); } } |