vrnithinkumar marked an inline comment as done.
vrnithinkumar added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:494-496
+      OS << "Smart pointer";
+      checkAndPrettyPrintRegion(OS, ThisRegion);
+      OS << " is non-null";
----------------
NoQ wrote:
> Because these note tags aren't specific to the bug report at hand, they have 
> to be marked as //prunable// (i.e., the optional `getNoteTag()`'s parameter 
> "`IsPrunable`" should be set to true). That'd reduce bug report clutter by 
> not bringing in stack frames that aren't otherwise interesting for the bug 
> report.
> 
> Something like this may act as a test (i didn't try):
> ```lang=c++
> struct S {
>   std::unique_ptr<int> P;
> 
>   void foo() {
>     if (!P) { // no-note because foo() is pruned
>       return;
>     }
>   }
> 
>   int bar() {
>     P = new int(0);
>     foo();
>     return 1 / *P; // warning: division by zero
>   }
> 
> }
> 
> ```
Marked these tags as prunable and added the tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86027

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to