Skip to content

Commit 2876f93

Browse files
committed
Fix clang-18 CI failure due to non-constexpr deque
1 parent 072e521 commit 2876f93

File tree

1 file changed

+4
-5
lines changed
  • libcxx/test/std/algorithms/alg.modifying.operations/alg.copy

1 file changed

+4
-5
lines changed

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct CopyFromForwardIterToBitIter {
112112
};
113113

114114
// Test std::copy with segmented iterators: deque<T>::iterator, join_view::iterator
115-
TEST_CONSTEXPR_CXX23 void test_segmented_iterator() {
115+
void test_segmented_iterator() { // TODO: Mark this test as TEST_CONSTEXPR_CXX23 when std::deque is constexpr
116116
// std::deque iterator
117117
{ // Copy from segmented input to contiguous output (deque<int> to vector<int>)
118118
std::deque<int> in(20);
@@ -164,9 +164,8 @@ TEST_CONSTEXPR_CXX23 void test_segmented_iterator() {
164164
std::vector<int> out(expected.size());
165165
std::copy(jv.begin(), jv.end(), out.begin());
166166
assert(out == expected);
167-
}
168-
// Copy from segmented input to segmented output (join_view to deque)
169-
if (!TEST_IS_CONSTANT_EVALUATED) { // TODO: enable this for constant evaluation when std::deque is fully constexpr
167+
}
168+
{ // Copy from segmented input to segmented output (join_view to deque)
170169
std::vector<std::vector<int>> v{{1, 2}, {1, 2, 3}, {0, 0}, {3, 4, 5}, {6}, {7, 8, 9, 6}, {0, 1, 2, 3, 0, 1, 2}};
171170
auto jv = std::ranges::join_view(v);
172171
std::deque<int> expected(jv.begin(), jv.end());
@@ -368,7 +367,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
368367
types::for_each(types::forward_iterator_list<bool*>(), CopyFromForwardIterToBitIter<299>());
369368
}
370369

371-
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: enable this unconditionally when std::deque is fully constexpr
370+
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED when std::deque is made constexpr
372371
test_segmented_iterator();
373372

374373
return true;

0 commit comments

Comments
 (0)