[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:24:09 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93699
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
P.S. it helps to provide a testcase that doesn't have lots of spurious warnings
when compiled with -Wall -Wextra, because one of the first things I'm going to
do when triaging bug reports is compile with those warnings on.
Uninitialized variables and unused parameters that are not relevant to the bug
are just noise.
Reduced testcase:
struct Base {
virtual int operator==(const Base&) const {
return 1;
}
};
struct Derived : public Base {
virtual int operator==(const Base&) const {
return 1;
}
};
int main()
{
Base* b = nullptr;
Derived* d = nullptr;
if (*b == *d) {
return 1;
}
}
More information about the Gcc-bugs
mailing list