Skip to content

Commit a7041cc

Browse files
committed
Fix test and ADL call
1 parent c113266 commit a7041cc

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

libcxx/include/__algorithm/for_each.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ _LIBCPP_PUSH_MACROS
2727

2828
_LIBCPP_BEGIN_NAMESPACE_STD
2929

30+
template <class _InputIterator, class _Function>
31+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Function
32+
for_each(_InputIterator __first, _InputIterator __last, _Function __f);
33+
3034
template <class, class _InputIterator, class _Function>
3135
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Function
3236
__for_each(_InputIterator __first, _InputIterator __last, _Function& __f) {
@@ -53,7 +57,7 @@ for_each(_SegmentedIterator __first, _SegmentedIterator __last, _Function& __fun
5357
template <class _InputIterator, class _Function>
5458
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Function
5559
for_each(_InputIterator __first, _InputIterator __last, _Function __f) {
56-
return __for_each<_ClassicAlgPolicy>(__first, __last, __f);
60+
return std::__for_each<_ClassicAlgPolicy>(__first, __last, __f);
5761
}
5862

5963
_LIBCPP_END_NAMESPACE_STD

libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ struct deque_test {
4545
}
4646
};
4747

48-
/*TEST_CONSTEXPR_CXX23*/
49-
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX23 once std::deque is constexpr
48+
/*TEST_CONSTEXPR_CXX26*/
49+
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX26 once std::deque is constexpr
5050
// check that segmented deque iterators work properly
5151
int sizes[] = {0, 1, 2, 1023, 1024, 1025, 2047, 2048, 2049};
5252
for (const int size : sizes) {
@@ -102,7 +102,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
102102
}
103103
#endif
104104

105-
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED when std::deque is made constexpr
105+
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_26_OR_RUNTIME_EVALUATED when std::deque is made constexpr
106106
test_segmented_deque_iterator();
107107

108108
#if TEST_STD_VER >= 20

libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ struct deque_test {
125125
}
126126
};
127127

128-
/*TEST_CONSTEXPR_CXX23*/
129-
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX23 once std::deque is constexpr
128+
/*TEST_CONSTEXPR_CXX26*/
129+
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX26 once std::deque is constexpr
130130
// check that segmented deque iterators work properly
131131
int sizes[] = {0, 1, 2, 1023, 1024, 1025, 2047, 2048, 2049};
132132
for (const int size : sizes) {
@@ -173,7 +173,7 @@ constexpr bool test() {
173173
}
174174
}
175175

176-
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED when std::deque is made constexpr
176+
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_26_OR_RUNTIME_EVALUATED when std::deque is made constexpr
177177
test_segmented_deque_iterator();
178178

179179
{

libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each_n.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ struct deque_test {
8181
}
8282
};
8383

84-
/*TEST_CONSTEXPR_CXX23*/
85-
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX23 once std::deque is constexpr
84+
/*TEST_CONSTEXPR_CXX26*/
85+
void test_segmented_deque_iterator() { // TODO: Mark as TEST_CONSTEXPR_CXX26 once std::deque is constexpr
8686
// check that segmented deque iterators work properly
8787
int sizes[] = {0, 1, 2, 1023, 1024, 1025, 2047, 2048, 2049};
8888
for (const int size : sizes) {
@@ -118,7 +118,7 @@ constexpr bool test() {
118118
assert(a[2].other == 6);
119119
}
120120

121-
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED when std::deque is made constexpr
121+
if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_26_OR_RUNTIME_EVALUATED when std::deque is made constexpr
122122
test_segmented_deque_iterator();
123123

124124
{

0 commit comments

Comments
 (0)