[libc++] Fix broken tuple tests

The tests had copy-paste errors which started showing when an
unused-variable warning started being emitted after we made
the MoveOnly type constexpr (in a4b8ee6422).
This commit is contained in:
Louis Dionne 2020-05-22 15:32:29 -04:00
parent 65cd2c7a80
commit 861b526933
3 changed files with 18 additions and 18 deletions

View File

@ -89,16 +89,16 @@ int main(int, char**)
Tup t(E(0), E(1));
static_assert(std::is_constructible<Tup, E, E>::value, "");
static_assert(!test_convertible<Tup, E, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == 1);
assert(std::get<2>(t) == MoveOnly());
assert(std::get<0>(t) == E(0));
assert(std::get<1>(t) == E(1));
assert(std::get<2>(t) == E());
Tup t2(E(0));
static_assert(std::is_constructible<Tup, E>::value, "");
static_assert(!test_convertible<Tup, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == E());
assert(std::get<2>(t) == E());
assert(std::get<0>(t2) == E(0));
assert(std::get<1>(t2) == E());
assert(std::get<2>(t2) == E());
}
// Check that SFINAE is properly applied with the default reduced arity
// constructor extensions.

View File

@ -99,15 +99,15 @@ int main(int, char**)
Tup t = {E(0), E(1)};
static_assert(test_convertible<Tup, E, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == 1);
assert(std::get<2>(t) == MoveOnly());
assert(std::get<0>(t) == E(0));
assert(std::get<1>(t) == E(1));
assert(std::get<2>(t) == E());
Tup t2 = {E(0)};
static_assert(test_convertible<Tup, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == E());
assert(std::get<2>(t) == E());
assert(std::get<0>(t2) == E(0));
assert(std::get<1>(t2) == E());
assert(std::get<2>(t2) == E());
}
// Check that SFINAE is properly applied with the default reduced arity
// constructor extensions.

View File

@ -132,15 +132,15 @@ int main(int, char**)
Tup t(E(0), E(1));
static_assert(!test_convertible<Tup, E, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == 1);
assert(std::get<2>(t) == MoveOnly());
assert(std::get<0>(t) == E(0));
assert(std::get<1>(t) == E(1));
assert(std::get<2>(t) == E());
Tup t2(E(0));
static_assert(!test_convertible<Tup, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == E());
assert(std::get<2>(t) == E());
assert(std::get<0>(t2) == E(0));
assert(std::get<1>(t2) == E());
assert(std::get<2>(t2) == E());
}
#endif
#if TEST_STD_VER > 11