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

Jakub Mazurkiewicz via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 14:34:20 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_;
   }
----------------
JMazurkiewicz wrote:

I've tried changing default argument to `_Const` and removing it, and in both cases test failed. I think that current coverage is enough.

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


More information about the cfe-commits mailing list