Skip to content

Commit e96fbf9

Browse files
committed
[libc++][C++03] partially cherry-pick llvm#122641
1 parent 0a9b54b commit e96fbf9

File tree

2 files changed

+3
-4
lines changed
  • libcxx

2 files changed

+3
-4
lines changed

libcxx/include/__cxx03/__algorithm/find.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ __find_bool(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
105105
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
106106
__storage_type __b = std::__invert_if<!_ToFind>(*__first.__seg_) & __m;
107107
if (__b)
108-
return _It(__first.__seg_, static_cast<unsigned>(std::__libcpp_ctz(__b)));
108+
return _It(__first.__seg_, static_cast<unsigned>(std::__countr_zero(__b)));
109109
if (__n == __dn)
110110
return __first + __n;
111111
__n -= __dn;
@@ -115,14 +115,14 @@ __find_bool(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
115115
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) {
116116
__storage_type __b = std::__invert_if<!_ToFind>(*__first.__seg_);
117117
if (__b)
118-
return _It(__first.__seg_, static_cast<unsigned>(std::__libcpp_ctz(__b)));
118+
return _It(__first.__seg_, static_cast<unsigned>(std::__countr_zero(__b)));
119119
}
120120
// do last partial word
121121
if (__n > 0) {
122122
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
123123
__storage_type __b = std::__invert_if<!_ToFind>(*__first.__seg_) & __m;
124124
if (__b)
125-
return _It(__first.__seg_, static_cast<unsigned>(std::__libcpp_ctz(__b)));
125+
return _It(__first.__seg_, static_cast<unsigned>(std::__countr_zero(__b)));
126126
}
127127
return _It(__first.__seg_, static_cast<unsigned>(__n));
128128
}

libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4245 /wd4305 /wd4310 /wd4389 /wd4805
1818
// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=20000000
1919
// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=80000000
20-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
2120

2221
// <algorithm>
2322

0 commit comments

Comments
 (0)