https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109568

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to zed.three from comment #3)
> But should the warning not be on the `var_ref->empty()` call itself then,
> instead of inside `shared_ptr::operator==`? I guess that it's ultimately
> triggered by the implicit `this` in accessing `_M_ptr`, but it would be more
> obvious it it were bubbled up to `var_ref`

The method is inlined and the warning is diagnosed only after that happens, so
it diagnoses it on the actual (potential, it isn't unconditional) null pointer
dereference it sees at that point.

Reply via email to