[libcxx-commits] [PATCH] D102327: [pstl] Use logical operator for loop condition in tests
Jonathan Wakely via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 12 07:18:22 PDT 2021
jwakely created this revision.
jwakely added reviewers: ldionne, rodgert.
jwakely requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Fix a probable typo in two PSTL tests that causes warnings with GCC.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102327
Files:
pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
Index: pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
===================================================================
--- pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
+++ pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
@@ -71,7 +71,7 @@
{
Sequence<T> 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<T>());
Index: pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
===================================================================
--- pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
+++ pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
@@ -81,7 +81,7 @@
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<T>());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102327.344815.patch
Type: text/x-patch
Size: 1395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210512/282a01c1/attachment.bin>
More information about the libcxx-commits
mailing list