From: Stephan T. Lavavej Date: Wed, 23 Nov 2016 22:02:53 +0000 (+0000) Subject: [libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8eb5ce86529a3f67571b07d5a47419bb8c9cd230;p=platform%2Fupstream%2Fllvm.git [libcxx] [test] D27020: 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(-1));". ~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests). llvm-svn: 287827 --- diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp index 8c09f4f..d96ccf9 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp @@ -37,7 +37,7 @@ test() test1(); test1(); test1(); - const T M(~0); + const T M(static_cast(-1)); test1(); test1(); test1(); diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp index 4b2b20d..b38e8f5 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp @@ -37,7 +37,7 @@ test() test1(); test1(); test1(); - const T M(~0); + const T M(static_cast(-1)); test1(); test1(); test1(); diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp index 6c4a7f4..734b420 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp @@ -36,7 +36,7 @@ test() test1(); test1(); test1(); - const T M(~0); + const T M(static_cast(-1)); test1(); test1(); test1(); diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index 7ff4480..cd496fd 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -72,7 +72,7 @@ test() test1(); test1(); test1(); - const T M(~0); + const T M(static_cast(-1)); test1(); test1(); test1();