mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-26 21:30:42 +00:00
[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:
parent
79d2a7134b
commit
4fd9329d34
@ -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};
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user