From 68a694b800a9bb5f5cbbc5d8c956a87273356d20 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 6 Dec 2016 01:13:14 +0000 Subject: [libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", part 9/12. Add static_cast to more comparisons. (Performed manually, unlike part 8/12.) Also, include when it wasn't already being included. llvm-svn: 288746 --- .../support.initlist/support.initlist.access/access.pass.cpp | 5 +++-- .../support.initlist/support.initlist.range/begin_end.pass.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'libcxx/test/std/language.support/support.initlist') 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 #include +#include #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(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(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 #include +#include #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(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(e - b) == il.size()); assert(*b++ == 3); assert(*b++ == 2); assert(*b++ == 1); -- cgit v1.2.3