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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 4 07:14:01 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
----------------
frederick-vs-ja wrote:

There's no CWG issue for this, but I think [P3606R1](https://wg21.link/p3606r1) is closely related. The paper should be a DR if accepted, I believe.

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


More information about the libcxx-commits mailing list