From c0a2d3b90b3b024247cb38f73219ed595e974431 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Mon, 28 Dec 2020 18:46:07 -0500 Subject: [PATCH] [libc++] Fix a test failure in 7b00e9fae3 (D93815). "LLVM Buildbot on libcxx-libcxxabi-libunwind-armv7-linux" is not happy with comparing `unsigned` and `int` [-Werror,-Wsign-compare]. --- .../func.search/func.search.default/default.pred.pass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp index bc9ba2f..59e5f7f 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp @@ -40,7 +40,7 @@ struct count_equal { - unsigned *count; + int *count; template TEST_CONSTEXPR_CXX14 bool operator()(const T& x, const T& y) const @@ -50,11 +50,11 @@ struct count_equal template TEST_CONSTEXPR_CXX20 void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { - unsigned count = 0; + int count = 0; std::default_searcher s{b2, e2, count_equal{&count}}; assert(result == std::search(b1, e1, s)); - auto d1 = std::distance(b1, e1); - auto d2 = std::distance(b2, e2); + int d1 = std::distance(b1, e1); + int d2 = std::distance(b2, e2); assert((count >= 1) || (d2 == 0) || (d1 < d2)); assert((d1 < d2) || count <= d1 * (d1 - d2 + 1)); } -- 2.7.4