From a4f07b4d2e8d3523cd6454cf8a9410c0cfca0410 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 14 Oct 2019 14:38:12 +0000 Subject: [PATCH] [libc++][test] Silence more warnings in variant tests More cases of signed-to-unsigned conversion warnings that missed the train for d2623522. llvm-svn: 374778 --- .../std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp | 2 +- .../std/utilities/variant/variant.variant/variant.assign/move.pass.cpp | 2 +- .../variant/variant.variant/variant.mod/emplace_index_args.pass.cpp | 2 +- .../variant/variant.variant/variant.mod/emplace_type_args.pass.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp index 07ca63f..489dd5d 100644 --- a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp @@ -547,7 +547,7 @@ void test_copy_assignment_different_index() { struct { constexpr Result operator()() const { using V = std::variant; - V v(std::in_place_type, 43); + V v(std::in_place_type, 43u); V v2(std::in_place_type, 42); v = v2; return {v.index(), std::get<1>(v).value}; diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp index b70f7aa..daa5512 100644 --- a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp @@ -407,7 +407,7 @@ void test_move_assignment_different_index() { } { using V = std::variant; - V v1(std::in_place_type, 43); + V v1(std::in_place_type, 43u); V v2(std::in_place_type, 42); MoveAssign::reset(); V &vref = (v1 = std::move(v2)); diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp index b09e357..47823b3 100644 --- a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp @@ -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, ""); assert(std::get<4>(v) == "aaa"); assert(&ref3 == &std::get<4>(v)); diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp index e0a048a..8e68823 100644 --- a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp @@ -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(3, 'a'); + auto& ref3 = v.emplace(3u, 'a'); static_assert(std::is_same_v, ""); assert(std::get<4>(v) == "aaa"); assert(&ref3 == &std::get<4>(v)); -- 2.7.4