[PATCH] D98726: [analyzer] Remove unnecessary TODO

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 13:02:28 PDT 2021


NoQ added a comment.

In D98726#2629722 <https://reviews.llvm.org/D98726#2629722>, @steakhal wrote:

> For example this code does not trigger any warning:
> https://godbolt.org/z/aM4xe7

FTFY: https://godbolt.org/z/vT5c7s

This test isn't very interesting though because the warning doesn't have anything to do with the smart pointer. Any use of the pointer after `delete` deserves a warning regardless of whether it's coming from the smart pointer or not. In other words, in this test case MallocChecker doesn't start tracking the pointer at `release()` but it only starts tracking the pointer later, at `delete`.

A more interesting test would be to diagnose a leak if the pointer isn't deleted. Which we don't do: https://godbolt.org/z/1EczEW So, yeah, i think this TODO is still relevant.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98726/new/

https://reviews.llvm.org/D98726



More information about the cfe-commits mailing list