forked from OSchip/llvm-project
[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:
parent
65cd2c7a80
commit
861b526933
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue