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

--- Comment #3 from Avi Kivity <avi at scylladb dot com> ---
Does one have to declare all preconditions? I happen to know that shared_ptr
with a reference count of zero is impossible, and I can understand the compiler
not being able to infer it, but just because it's unable to infer it doesn't
mean my code is wrong.

Maybe the warning should be renamed -Wmaybe-use-after-free to indicate the
compiler just thinks there may be a bug, but also acknowledges it doesn't know
everything.

Reply via email to