// PR c++/107542 // { dg-do compile { target c++20 } } #include template concept same_as = __is_same(T, U); template concept Ord = requires(Lhs lhs, Rhs rhs) { { lhs <=> rhs } -> same_as; }; static_assert(Ord); // Works. static_assert(!Ord); // ICE. template struct S { T* p; }; template requires(Ord) constexpr inline auto operator<=>(const S& l, const S& r) noexcept { return l.p <=> r.p; } static_assert(Ord, S>); // Works. static_assert(!Ord, S>); // ICE.