[libc++][test] Silence more warnings in variant tests

More cases of signed-to-unsigned conversion warnings that missed the train for d2623522.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Casey Carter 2019-10-14 14:38:12 +00:00
parent 79d2a7134b
commit 4fd9329d34
4 changed files with 4 additions and 4 deletions

View File

@ -547,7 +547,7 @@ void test_copy_assignment_different_index() {
struct {
constexpr Result<int> operator()() const {
using V = std::variant<int, TCopyAssign, unsigned>;
V v(std::in_place_type<unsigned>, 43);
V v(std::in_place_type<unsigned>, 43u);
V v2(std::in_place_type<TCopyAssign>, 42);
v = v2;
return {v.index(), std::get<1>(v).value};

View File

@ -407,7 +407,7 @@ void test_move_assignment_different_index() {
}
{
using V = std::variant<int, MoveAssign, unsigned>;
V v1(std::in_place_type<unsigned>, 43);
V v1(std::in_place_type<unsigned>, 43u);
V v2(std::in_place_type<MoveAssign>, 42);
MoveAssign::reset();
V &vref = (v1 = std::move(v2));

View File

@ -111,7 +111,7 @@ void test_basic() {
assert(std::get<2>(v) == &x);
assert(&ref2 == &std::get<2>(v));
// emplace with multiple args
auto& ref3 = v.emplace<4>(3, 'a');
auto& ref3 = v.emplace<4>(3u, 'a');
static_assert(std::is_same_v<std::string&, decltype(ref3)>, "");
assert(std::get<4>(v) == "aaa");
assert(&ref3 == &std::get<4>(v));

View File

@ -111,7 +111,7 @@ void test_basic() {
assert(std::get<2>(v) == &x);
assert(&ref2 == &std::get<2>(v));
// emplace with multiple args
auto& ref3 = v.emplace<std::string>(3, 'a');
auto& ref3 = v.emplace<std::string>(3u, 'a');
static_assert(std::is_same_v<std::string&, decltype(ref3)>, "");
assert(std::get<4>(v) == "aaa");
assert(&ref3 == &std::get<4>(v));