From 7f607ac6af0e2ee8a7d721d3ba427536deffcd3f Mon Sep 17 00:00:00 2001 From: zoecarver Date: Thu, 13 May 2021 10:09:15 -0700 Subject: [PATCH] [pstl] Use logical operator for loop condition in tests Fix a probable typo in two PSTL tests that causes warnings with GCC. Patch by Jonathan Wakely (jwakely). Reviewed By: zoecarver Differential Revision: https://reviews.llvm.org/D102327 --- pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp | 2 +- pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp index c72d6239273e..1e07a96003a5 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp @@ -81,7 +81,7 @@ test(const std::size_t bits) for (auto r : res) { std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = sub[isub]; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, sub.begin(), sub.begin() + n2, std::equal_to()); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp index 3e7868a11e5d..d009df919a30 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp @@ -71,7 +71,7 @@ test() { Sequence in(n1, [](std::size_t) { return T(0); }); std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = value; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, n2, value, std::equal_to());