[Bug analyzer/98830] -Wanalyzer-null-argument on static_cast and inheritance
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 26 00:07:35 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98830
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Why is it a false positive? The call to p->f () is a call to
B* B::f ();
and that could return NULL, hence the call to C::g would be passing NULL as
'this'.
Arguably the message would be more readable as "possible false positive" and
the path ought to express that it happens when B::f returns NULL.
More information about the Gcc-bugs
mailing list