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

--- Comment #5 from heinzisoft at web dot de ---
(In reply to Jonathan Wakely from comment #2)
> It is a dangling pointer, but it can't be dereferenced, so it doesn't matter.
> 
> It's only used by std::call_once and will be set to a different local
> variable by the next call. We could zero the pointer, but it would be a
> waste of cycles.

Can we still fix this? It prevents people from doing clang-tidy analysis on
their code base because it can't be distinguished from errors in their code.

Since it actually is a dangling pointer, I don't think we can push
responsibility to clang-tidy. If we don't want to waste the cycle of setting it
to zero, we could consider adding something to make clang-tidy ignore this
error. I think this can be done with special comments.

Reply via email to