https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96489

--- Comment #5 from DV Henkel-Wallace <gu...@henkel-wallace.org> ---
(In reply to Jonathan Wakely from comment #4)
> I believe the rationale for this is that if your <=> can't be defaulted,
> then it must be doing something special, and synthesizing == from it is not
> necessarily safe.

The thing is: properly written user defined operator <=> is supposed to to be
"correct" (whatever that would mean!) for all of the < 0, = 0, and > 0 cases. 
It doesn't make sense to presume that a user defined <=> would only apply to
the < and > cases -- in fact how could it otherwise synthesize <= and => ?

(More jocularly it's not `operator <>` -- would we call that the submarine
operator?)

In fact I just changed my test case to use `((a <=> b) != 0)` and it did what I
expected.

> Clang agrees with GCC FWIW.

Yes, reported it to them too :-(

Reply via email to