(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp2a/
spaceship-synth-neg2.C
// PR c++/92774
// { dg-do compile { target c++20 } }

#include <compare>

template<typename T>
struct X { };

template<typename T>
bool operator==(const X<T>&, const X<T>&) { return true; }
template<typename T>
bool operator<(const X<T>&, const X<T>&) { return true; }

struct Y
{
  int a;
  X<int> c;			// { dg-error "no match" }

  auto operator <=>(Y const&) const = default;
};

void f()
{
  auto x = Y() < Y();		// { dg-error "deleted" }
}