[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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289264 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2016-12-09 19:53:08 +00:00
parent 2fe522f79a
commit aa1d62b4af
3 changed files with 21 additions and 18 deletions

View File

@@ -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));
}
}