diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-06 01:13:14 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-06 01:13:14 +0000 |
commit | 68a694b800a9bb5f5cbbc5d8c956a87273356d20 (patch) | |
tree | a430a87c856cde5972651895df9f274cdd98a9e3 /libcxx/test/std/language.support/support.initlist | |
parent | fbfb2ab63e94f1b0c248cd810ae3fb35889d99b6 (diff) | |
download | bcm5719-llvm-68a694b800a9bb5f5cbbc5d8c956a87273356d20.tar.gz bcm5719-llvm-68a694b800a9bb5f5cbbc5d8c956a87273356d20.zip |
[libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", part 9/12.
Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.)
Also, include <cstddef> when it wasn't already being included.
llvm-svn: 288746
Diffstat (limited to 'libcxx/test/std/language.support/support.initlist')
2 files changed, 6 insertions, 4 deletions
diff --git a/libcxx/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/libcxx/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp index c4cbc15ba7e..e51ef7bd923 100644 --- a/libcxx/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp +++ b/libcxx/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp @@ -15,6 +15,7 @@ #include <initializer_list> #include <cassert> +#include <cstddef> #include "test_macros.h" @@ -27,7 +28,7 @@ struct A const int* b = il.begin(); const int* e = il.end(); assert(il.size() == 3); - assert(e - b == il.size()); + assert(static_cast<std::size_t>(e - b) == il.size()); assert(*b++ == 3); assert(*b++ == 2); assert(*b++ == 1); @@ -42,7 +43,7 @@ struct B const int* b = il.begin(); const int* e = il.end(); assert(il.size() == 3); - assert(e - b == il.size()); + assert(static_cast<std::size_t>(e - b) == il.size()); assert(*b++ == 3); assert(*b++ == 2); assert(*b++ == 1); diff --git a/libcxx/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/libcxx/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp index f76aa5f721d..938025d385f 100644 --- a/libcxx/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp +++ b/libcxx/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp @@ -13,6 +13,7 @@ #include <initializer_list> #include <cassert> +#include <cstddef> #include "test_macros.h" @@ -25,7 +26,7 @@ struct A const int* b = begin(il); const int* e = end(il); assert(il.size() == 3); - assert(e - b == il.size()); + assert(static_cast<std::size_t>(e - b) == il.size()); assert(*b++ == 3); assert(*b++ == 2); assert(*b++ == 1); @@ -40,7 +41,7 @@ struct B const int* b = begin(il); const int* e = end(il); assert(il.size() == 3); - assert(e - b == il.size()); + assert(static_cast<std::size_t>(e - b) == il.size()); assert(*b++ == 3); assert(*b++ == 2); assert(*b++ == 1); |