Skip to content

Commit 537e819

Browse files
Fix MSVC warning C4127 "conditional expression is constant" for an always-true branch.
This was very recently introduced by LLVM-129008 making `N` constexpr. As it's a local constant just nine lines above, we don't need to test whether 100 is greater than 0.
1 parent d8ad20d commit 537e819

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,9 @@ TEST_CONSTEXPR_CXX26 bool test() {
161161
std::sort(ia, ia + M, indirect_less());
162162
std::sort(ia + M, ia + N, indirect_less());
163163
std::inplace_merge(ia, ia + M, ia + N, indirect_less());
164-
if (N > 0) {
165-
assert(*ia[0] == 0);
166-
assert(*ia[N - 1] == N - 1);
167-
assert(std::is_sorted(ia, ia + N, indirect_less()));
168-
}
164+
assert(*ia[0] == 0);
165+
assert(*ia[N - 1] == N - 1);
166+
assert(std::is_sorted(ia, ia + N, indirect_less()));
169167
delete[] ia;
170168
}
171169
#endif // TEST_STD_VER >= 11

0 commit comments

Comments
 (0)