From: Casey Carter Date: Mon, 14 Oct 2019 14:38:12 +0000 (+0000) Subject: [libc++][test] Silence more warnings in variant tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4f07b4d2e8d3523cd6454cf8a9410c0cfca0410;p=platform%2Fupstream%2Fllvm.git [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 --- 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));