https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98830
David Malcolm changed:
What|Removed |Added
Last reconfirmed||2021-01-26
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98830
--- Comment #3 from Martin Sebor ---
The warning in pr98646 was determined to be a false positive at least in part
because the cast was guarded by a test for the result of the call being
nonnull, like so:
if (p->f ())
static_cast(p->f ())-
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98830
--- Comment #2 from David Malcolm ---
I looked at your examples in bug 98646, and the analyzer seems to me to be
working correctly.
Specifically:
Analyzer correctly doesn't warn for:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98646#c5
Anal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98830
--- Comment #1 from David Malcolm ---
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