Reduced example: #include <compare> struct X { auto operator<=>(X const&) const = default; auto operator==(int i) const; }; bool f(X x) { return x == x; } gcc trunk rejects this saying no matching candidate. The presence of the unrelated operator== seems to prevent the generation of X::operator==(X const&) const from the defaulted <=>.
Confirmed.
Per [class.compare.default] (http://eel.is/c++draft/class.compare.default#5.sentence-1 ), the == operator is implicitly generated if the member-specification does not declare *any* operator==. So the current behavior seems correct?
I believe, GCC is correct here as well as other compilers: https://gcc.godbolt.org/z/4nrdedbGd