NoQ added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:148
+    if (InnerPointVal && InnerPointVal->isZeroConstant()) {
+      reportBug(C, Call);
+    }
----------------
This doesn't seem to be guarded by `ShouldCheckSmartPtrDereference`.

Consider adding a LIT test for the flag to make sure we're not leaking our 
project to the public until it's ready ^.^ Say, you could make two run-lines in 
your test like this:
```
// RUN: %clang_analyze_cc1 -verify=expected -analyzer-config 
cplusplus.SmartPtr:CheckSmartPtrDereference=true \
// RUN: ...
// RUN: %clang_analyze_cc1 -verify=unexpected \
// RUN: ...

// unexpected-no-diagnostics
```
(see https://clang.llvm.org/doxygen/classclang_1_1VerifyDiagnosticConsumer.html 
for more fancy tricks with `-verify`)


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

https://reviews.llvm.org/D81315



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

Reply via email to