This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.
ClosedPublic

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

Details

Summary

[libcxx] [test] Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.

When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".

~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 78989.Nov 22 2016, 4:50 PM
STL_MSFT retitled this revision from to [libcxx] [test] Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/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:47 PM
EricWF edited edge metadata.
This revision is now accepted and ready to land.Nov 22 2016, 10:47 PM
STL_MSFT closed this revision.Nov 23 2016, 2:17 PM

Thanks, r287827.