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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 4 07:02:15 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
----------------
ldionne wrote:

I added a comment about https://wg21.link/CWG2369 but there's no actual CWG issue tracking the fix at the moment. But since LWG is already aware of the problem, I don't think it makes sense to try creating a CWG issue (they will if they think it's worth it).

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


More information about the libcxx-commits mailing list