[libcxx-commits] [libcxx] [libc++] Fix constraint recursion in std::expected's operator== (PR #201455)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 4 01:35:27 PDT 2026


================
@@ -1161,8 +1161,11 @@ class expected : private __expected_base<_Tp, _Err> {
     }
   }
 
-  template <class _T2>
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected& __x, const _T2& __v)
+  // The unusual signature avoids constraint recursion via ADL through
----------------
philnik777 wrote:

I think we should add a comment here about some CWG issue. IIRC this isn't a problem with GCC.

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


More information about the libcxx-commits mailing list