https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111690
Bug ID: 111690 Summary: Redefinition of operator == not detected with friend <=> Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the example: ``` #include <compare> struct Foo { friend auto operator<=>(const Foo&, const Foo&) = default; }; bool operator==(const Foo& x, const Foo& y) noexcept { return true; } void Test() { Foo{} == Foo{}; } ``` If my reading of [class.compare.default] p4 correct, then an == operator function is already declared implicitly due to operator<=>. So there should be an error of redeclaring or redefining the operator==. Godbolt playground: https://godbolt.org/z/YP5vEMeYs