Index: test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp =================================================================== --- test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp +++ test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "test_iterators.h" #include "test_macros.h" @@ -70,14 +71,14 @@ end = std::sample(PopulationIterator(ia), PopulationIterator(ia + is), SampleIterator(oa), os, g); - assert(end.base() - oa == std::min(os, is)); + assert(static_cast(end.base() - oa) == std::min(os, is)); // sample() is deterministic but non-reproducible; // its results can vary between implementations. LIBCPP_ASSERT(std::equal(oa, oa + os, oa1)); end = std::sample(PopulationIterator(ia), PopulationIterator(ia + is), SampleIterator(oa), os, std::move(g)); - assert(end.base() - oa == std::min(os, is)); + assert(static_cast(end.base() - oa) == std::min(os, is)); LIBCPP_ASSERT(std::equal(oa, oa + os, oa2)); } @@ -127,7 +128,7 @@ end = std::sample(PopulationIterator(ia), PopulationIterator(ia + is), SampleIterator(oa), os, g); - assert(end.base() - oa == std::min(os, is)); + assert(static_cast(end.base() - oa) == std::min(os, is)); typedef typename std::iterator_traits::iterator_category PopulationCategory; if (std::is_base_of::value) { assert(std::equal(oa, end.base(), oa1)); Index: test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp =================================================================== --- test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp +++ test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp @@ -14,12 +14,13 @@ #include #include +#include int main() { int a[] = {3, 5, 2, 0, 6, 8, 1}; int* an = a + sizeof(a)/sizeof(a[0]); std::priority_queue q(a, an); - assert(q.size() == an - a); + assert(q.size() == static_cast(an - a)); assert(q.top() == 8); } Index: test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp =================================================================== --- test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp +++ test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp @@ -15,6 +15,7 @@ #include #include #include +#include int main() { @@ -22,6 +23,6 @@ int* an = a + sizeof(a)/sizeof(a[0]); std::priority_queue, std::greater > q(a, an, std::greater()); - assert(q.size() == an - a); + assert(q.size() == static_cast(an - a)); assert(q.top() == 0); } Index: test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp =================================================================== --- test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp +++ test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp @@ -49,7 +49,7 @@ typedef typename C::const_iterator CI; typename C::size_type c1_osize = c1.size(); c1.resize(size); - assert(c1.size() == size); + assert(c1.size() == static_cast(size)); assert(static_cast(distance(c1.begin(), c1.end())) == c1.size()); CI i = c1.begin(); for (int j = 0; static_cast(j) < std::min(c1_osize, c1.size()); ++j, ++i) Index: test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp =================================================================== --- test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp +++ test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp @@ -49,7 +49,7 @@ typedef typename C::const_iterator CI; typename C::size_type c1_osize = c1.size(); c1.resize(size, x); - assert(c1.size() == size); + assert(c1.size() == static_cast(size)); assert(static_cast(distance(c1.begin(), c1.end())) == c1.size()); CI i = c1.begin(); for (int j = 0; static_cast(j) < std::min(c1_osize, c1.size()); ++j, ++i) Index: test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp =================================================================== --- test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp +++ test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp @@ -47,7 +47,7 @@ { typedef typename C::const_iterator CI; c1.assign(size, v); - assert(c1.size() == size); + assert(c1.size() == static_cast(size)); assert(static_cast(distance(c1.begin(), c1.end())) == c1.size()); for (CI i = c1.begin(); i != c1.end(); ++i) assert(*i == v); Index: test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp =================================================================== --- test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp +++ test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "test_macros.h" #include "DefaultOnly.h" @@ -26,7 +27,7 @@ typedef std::forward_list C; C d(n, alloc); assert(d.get_allocator() == alloc); - assert(std::distance(d.begin(), d.end()) == n); + assert(static_cast(std::distance(d.begin(), d.end())) == n); #endif } Index: test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp =================================================================== --- test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp +++ test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "min_allocator.h" #include "counting_predicates.hpp" @@ -37,7 +38,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -49,7 +50,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -62,7 +63,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -86,7 +87,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } #if TEST_STD_VER >= 11 { @@ -100,7 +101,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -112,7 +113,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -125,7 +126,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } { typedef int T; @@ -149,7 +150,7 @@ Predicate cp(g); c1.remove_if(std::ref(cp)); assert(c1 == c2); - assert(cp.count() == std::distance(std::begin(t1), std::end(t1))); + assert(cp.count() == static_cast(std::distance(std::begin(t1), std::end(t1)))); } #endif } Index: test/std/containers/sequences/list/list.cons/size_type.pass.cpp =================================================================== --- test/std/containers/sequences/list/list.cons/size_type.pass.cpp +++ test/std/containers/sequences/list/list.cons/size_type.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" #include "DefaultOnly.h" #include "test_allocator.h" @@ -28,7 +29,7 @@ { C d(n, alloc); assert(d.size() == n); - assert(std::distance(d.begin(), d.end()) == n); + assert(static_cast(std::distance(d.begin(), d.end())) == n); assert(d.get_allocator() == alloc); } #endif Index: test/std/containers/sequences/vector.bool/find.pass.cpp =================================================================== --- test/std/containers/sequences/vector.bool/find.pass.cpp +++ test/std/containers/sequences/vector.bool/find.pass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include int main() { @@ -25,7 +26,7 @@ { std::vector b(i,true); std::vector::iterator j = std::find(b.begin()+1, b.end(), false); - assert(j-b.begin() == i); + assert(static_cast(j-b.begin()) == i); assert(b.end() == j); } } @@ -34,7 +35,7 @@ { std::vector b(i,false); std::vector::iterator j = std::find(b.begin()+1, b.end(), true); - assert(j-b.begin() == i); + assert(static_cast(j-b.begin()) == i); assert(b.end() == j); } } Index: test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp =================================================================== --- test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp +++ 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 @@ 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 @@ 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); Index: test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp =================================================================== --- test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp +++ 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 @@ 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 @@ 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); Index: test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp +++ test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp @@ -19,6 +19,7 @@ #include #include #include +#include typedef std::codecvt F; @@ -35,8 +36,8 @@ F::result r = f.in(mbs, from.data(), from.data() + from.size(), from_next, &to[0], &to[0] + to.size(), to_next); assert(r == F::ok); - assert(from_next - from.data() == from.size()); - assert(to_next - to.data() == expected.size()); - assert(to_next - to.data() == expected.size()); + assert(static_cast(from_next - from.data()) == from.size()); + assert(static_cast(to_next - to.data()) == expected.size()); + assert(static_cast(to_next - to.data()) == expected.size()); assert(to == expected); } Index: test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp =================================================================== --- test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp +++ test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp @@ -19,6 +19,7 @@ #include #include #include +#include typedef std::codecvt F; @@ -35,8 +36,8 @@ F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next, to.data(), to.data() + to.size(), to_next); assert(r == F::ok); - assert(from_next - from.data() == from.size()); - assert(to_next - to.data() == from.size()); + assert(static_cast(from_next - from.data()) == from.size()); + assert(static_cast(to_next - to.data()) == from.size()); assert(to.data() == std::string("some text")); } { @@ -49,8 +50,8 @@ F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next, to.data(), to.data() + to.size(), to_next); assert(r == F::ok); - assert(from_next - from.data() == from.size()); - assert(to_next - to.data() == from.size()); + assert(static_cast(from_next - from.data()) == from.size()); + assert(static_cast(to_next - to.data()) == from.size()); assert(memcmp(to.data(), "some\0text", from.size()) == 0); } { @@ -62,8 +63,8 @@ F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next, to.data(), to.data() + to.size()-1, to_next); assert(r == F::partial); - assert(from_next - from.data() == to.size()-1); - assert(to_next - to.data() == to.size()-1); + assert(static_cast(from_next - from.data()) == to.size()-1); + assert(static_cast(to_next - to.data()) == to.size()-1); assert(to.data() == std::string("some te")); } } Index: test/std/numerics/numarray/valarray.range/end_const.pass.cpp =================================================================== --- test/std/numerics/numarray/valarray.range/end_const.pass.cpp +++ test/std/numerics/numarray/valarray.range/end_const.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include int main() { @@ -26,6 +27,6 @@ const unsigned N = sizeof(a)/sizeof(a[0]); const std::valarray v(a, N); assert(v[v.size()-1] == 5); - assert(end(v) - begin(v) == v.size()); + assert(static_cast(end(v) - begin(v)) == v.size()); } } Index: test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp =================================================================== --- test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp +++ test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include int main() { @@ -27,6 +28,6 @@ std::valarray v(a, N); *(end(v) - 1) = 10; assert(v[v.size()-1] == 10); - assert(end(v) - begin(v) == v.size()); + assert(static_cast(end(v) - begin(v)) == v.size()); } } Index: test/std/re/re.results/re.results.acc/begin_end.pass.cpp =================================================================== --- test/std/re/re.results/re.results.acc/begin_end.pass.cpp +++ test/std/re/re.results/re.results.acc/begin_end.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "test_macros.h" void @@ -28,7 +29,7 @@ std::match_results::const_iterator i = m.begin(); std::match_results::const_iterator e = m.end(); - assert(e - i == m.size()); + assert(static_cast(e - i) == m.size()); for (int j = 0; i != e; ++i, ++j) assert(*i == m[j]); } Index: test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp =================================================================== --- test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp +++ test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "test_macros.h" void @@ -28,7 +29,7 @@ std::match_results::const_iterator i = m.cbegin(); std::match_results::const_iterator e = m.cend(); - assert(e - i == m.size()); + assert(static_cast(e - i) == m.size()); for (int j = 0; i != e; ++i, ++j) assert(*i == m[j]); } Index: test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp =================================================================== --- test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp +++ test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "test_macros.h" #include "test_allocator.h" @@ -61,7 +62,7 @@ typedef typename S::allocator_type A; S s2(n, c); LIBCPP_ASSERT(s2.__invariants()); - assert(s2.size() == n); + assert(s2.size() == static_cast(n)); for (int i = 0; i < n; ++i) assert(s2[i] == c); assert(s2.get_allocator() == A()); @@ -77,7 +78,7 @@ typedef typename S::traits_type T; S s2(n, c, a); LIBCPP_ASSERT(s2.__invariants()); - assert(s2.size() == n); + assert(s2.size() == static_cast(n)); for (int i = 0; i < n; ++i) assert(s2[i] == c); assert(s2.get_allocator() == a); Index: test/std/strings/basic.string/string.iterators/end.pass.cpp =================================================================== --- test/std/strings/basic.string/string.iterators/end.pass.cpp +++ test/std/strings/basic.string/string.iterators/end.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "min_allocator.h" @@ -29,8 +30,8 @@ assert(e == s.begin()); assert(ce == cs.begin()); } - assert(e - s.begin() == s.size()); - assert(ce - cs.begin() == cs.size()); + assert(static_cast(e - s.begin()) == s.size()); + assert(static_cast(ce - cs.begin()) == cs.size()); } int main() Index: test/std/strings/basic.string/string.iterators/rend.pass.cpp =================================================================== --- test/std/strings/basic.string/string.iterators/rend.pass.cpp +++ test/std/strings/basic.string/string.iterators/rend.pass.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "min_allocator.h" @@ -29,8 +30,8 @@ assert(e == s.rbegin()); assert(ce == cs.rbegin()); } - assert(e - s.rbegin() == s.size()); - assert(ce - cs.rbegin() == cs.size()); + assert(static_cast(e - s.rbegin()) == s.size()); + assert(static_cast(ce - cs.rbegin()) == cs.size()); } int main() Index: test/std/strings/string.view/string.view.iterators/end.pass.cpp =================================================================== --- test/std/strings/string.view/string.view.iterators/end.pass.cpp +++ test/std/strings/string.view/string.view.iterators/end.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" @@ -38,9 +39,9 @@ assert(ce2 != s.begin()); } - assert( e - s.begin() == s.size()); - assert(ce1 - cs.begin() == cs.size()); - assert(ce2 - s.cbegin() == s.size()); + assert(static_cast( e - s.begin()) == s.size()); + assert(static_cast(ce1 - cs.begin()) == cs.size()); + assert(static_cast(ce2 - s.cbegin()) == s.size()); assert( e == ce1); assert( e == ce2); Index: test/std/strings/string.view/string.view.iterators/rend.pass.cpp =================================================================== --- test/std/strings/string.view/string.view.iterators/rend.pass.cpp +++ test/std/strings/string.view/string.view.iterators/rend.pass.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "test_macros.h" @@ -38,9 +39,9 @@ assert(ce2 != s.rbegin()); } - assert( e - s.rbegin() == s.size()); - assert(ce1 - cs.rbegin() == cs.size()); - assert(ce2 - s.crbegin() == s.size()); + assert(static_cast( e - s.rbegin()) == s.size()); + assert(static_cast(ce1 - cs.rbegin()) == cs.size()); + assert(static_cast(ce2 - s.crbegin()) == s.size()); assert( e == ce1); assert( e == ce2);