[PATCH] D98726: [analyzer] Remove unnecessary TODO

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 11:37:02 PDT 2021


steakhal requested changes to this revision.
steakhal added a comment.
This revision now requires changes to proceed.

I don't think the `TODO` is addressed.
By checking the //git blame// quickly, there was no change committed to the `SmartPtrChecker` affecting the collaboration with the `MallocChecker` after the `TODO` was introduced in the source code.
Thus, I think the `TODO` is probably not yet addressed.

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

  void other(A *oldptr) {
    std::unique_ptr<A> P(oldptr);
    A* aptr = P.release();
    delete aptr;
    P->foo(); // No warning here, and probably this is case that the TODO want to describe.
  }

Nevertheless, this limitation deserves a test case with a FIXME, if it's not there already.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:16
 #include "SmartPtr.h"
+#include "AllocationState.h"
 
----------------
Why do you include this?


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