[libcxx-commits] [libcxx] [libc++] Fix instantiation of incomplete type when evaluating tuple's operator<=> (PR #204679)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 24 22:51:40 PDT 2026
================
@@ -1008,11 +1002,20 @@ public:
return std::__tuple_compare_equal<sizeof...(_Tp)>(__x, __y);
}
+ template <class _Tuple>
+ struct __common_comparison_category_with;
+
+ template <class... _Up>
+ requires requires { typename common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>; }
+ struct __common_comparison_category_with<tuple<_Up...>> {
+ using type _LIBCPP_NODEBUG = common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>;
+ };
+
template <__tuple_like_no_tuple _UTuple>
requires(sizeof...(_Tp) == tuple_size_v<_UTuple>)
- _LIBCPP_HIDE_FROM_ABI friend constexpr __tuple_common_comparison_category<tuple, _UTuple>
+ _LIBCPP_HIDE_FROM_ABI friend constexpr typename __common_comparison_category_with<__to_tuple_t<_UTuple>>::type
----------------
frederick-vs-ja wrote:
I guess we need to generalize the change to `operator==`'s constraints to make GCC happy.
https://github.com/llvm/llvm-project/pull/204679
More information about the libcxx-commits
mailing list