This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
ClosedPublic

Authored by STL_MSFT on Nov 22 2016, 4:48 PM.

Details

Summary

[libcxx] [test] Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.

Various changes:

test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.

test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 78985.Nov 22 2016, 4:48 PM
STL_MSFT retitled this revision from to [libcxx] [test] Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12..
STL_MSFT updated this object.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
EricWF accepted this revision.Nov 22 2016, 10:48 PM
EricWF edited edge metadata.
This revision is now accepted and ready to land.Nov 22 2016, 10:48 PM
STL_MSFT closed this revision.Nov 23 2016, 2:17 PM

Thanks, r287825.