[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 9 01:35:53 PDT 2021


vsavchenko added a comment.

Great, thanks for addressing my comments! I still have a couple of minor suggestions though.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:99-100
+
+const SmallVector<StringRef, 3> StdPtrNames = {"shared_ptr", "unique_ptr",
+                                               "weak_ptr"};
+
----------------
If it's a compile-time constant, let's make sure it is.
nit: I prefer global scope constants to be CAPITALIZED, so it's easier to spot them in the code.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:195
 
+const SmallVector<StringRef, 1> BasicOstreamName = {"basic_ostream"};
+
----------------
Same here + don't call it "Name" (singular).  It is a) an array and b) in the future, we might add more things to it, so we shouldn't need to rename it everywhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105421



More information about the cfe-commits mailing list