[libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", part 9/12.
Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.) Also, include <cstddef> when it wasn't already being included. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_allocator.h"
|
||||
@@ -61,7 +62,7 @@ test(Tp n, Tp c)
|
||||
typedef typename S::allocator_type A;
|
||||
S s2(n, c);
|
||||
LIBCPP_ASSERT(s2.__invariants());
|
||||
assert(s2.size() == n);
|
||||
assert(s2.size() == static_cast<std::size_t>(n));
|
||||
for (int i = 0; i < n; ++i)
|
||||
assert(s2[i] == c);
|
||||
assert(s2.get_allocator() == A());
|
||||
@@ -77,7 +78,7 @@ test(Tp n, Tp c, const A& a)
|
||||
typedef typename S::traits_type T;
|
||||
S s2(n, c, a);
|
||||
LIBCPP_ASSERT(s2.__invariants());
|
||||
assert(s2.size() == n);
|
||||
assert(s2.size() == static_cast<std::size_t>(n));
|
||||
for (int i = 0; i < n; ++i)
|
||||
assert(s2[i] == c);
|
||||
assert(s2.get_allocator() == a);
|
||||
|
||||
Reference in New Issue
Block a user