[lld] [clang-tools-extra] [libcxxabi] [openmp] [libc] [mlir] [flang] [lldb] [compiler-rt] [libcxx] [clang] [llvm] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 13:53:35 PST 2023


================
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template<bool _OtherConst = !_Const>
     requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const __sentinel& __rhs) {
     return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
----------------
huixie90 wrote:

Nothing to do with your patch, just wanted to point out that we don’t seem to have tests to test the default argument. (you don’t need to do it as this is nothing to do with the bug you are fixing)
template<bool _OtherConst = !_Const>

https://github.com/llvm/llvm-project/pull/74655


More information about the llvm-commits mailing list