This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Fix warning C4244 in `std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp`
ClosedPublic

Authored by fsb4000 on Aug 1 2022, 10:46 PM.

Details

Summary

frederick-vs-ja noticed that https://github.com/microsoft/STL/pull/2976#issuecomment-1201926893 while we are working on updating LLVM submodule for MS STL

C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): error C2220: the following warning is treated as an error
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(287): note: see reference to function template instantiation 'void tests<__int64>(void)' being compiled
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(38): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(51): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(56): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(69): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(74): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(87): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(92): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(105): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(110): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(123): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(128): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(141): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(146): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(162): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(167): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(183): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(188): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(204): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(209): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(225): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(230): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(246): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(251): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(267): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
C:\Dev\STL\llvm-project\libcxx\test\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(272): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
....

Diff Detail

Event Timeline

fsb4000 created this revision.Aug 1 2022, 10:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 10:46 PM
fsb4000 requested review of this revision.Aug 1 2022, 10:46 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 1 2022, 10:46 PM
ldionne accepted this revision.Aug 2 2022, 5:41 PM
ldionne added a subscriber: ldionne.

Nice catch, thanks.

This revision is now accepted and ready to land.Aug 2 2022, 5:41 PM