[Bug c++/93699] Invalid operator== (returning non-bool type) candidate
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 11 11:20:45 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93699
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[gcc10] Invalid operator== |Invalid operator==
|(returning non-bool type) |(returning non-bool type)
|candidate |candidate
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Started to be rejected with r277865 which implements operator<=>, and I think
the compiler is correct to reject it.
For (*b == *d) the arguments do not match Base::operator==(const Base&)
exactly, so the compiler tries a synthesized operator with reversed arguments,
which is ill-formed because of the bad return type.
More information about the Gcc-bugs
mailing list