This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4.
ClosedPublic

Authored by STL_MSFT on Nov 30 2016, 10:03 AM.

Details

Summary

[libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4.

Use static_cast<int> when storing size_t in int (or passing size_t to int).

Also, remove a spurious semicolon in test/support/archetypes.hpp.

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 79773.Nov 30 2016, 10:03 AM
STL_MSFT retitled this revision from to [libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4..
STL_MSFT updated this object.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
EricWF accepted this revision.Dec 2 2016, 11:26 PM
EricWF edited edge metadata.

LGTM nix inline comments. Please fix MemCounter to use size_t instead.

test/support/count_new.hpp
62

These should be changed to size_t instead.

This revision is now accepted and ready to land.Dec 2 2016, 11:26 PM
STL_MSFT updated this revision to Diff 80348.Dec 5 2016, 5:12 PM
STL_MSFT edited edge metadata.

Changed data members to size_t as requested (also changed parameters for consistency).

STL_MSFT closed this revision.Dec 5 2016, 5:29 PM

Thanks, r288752.