[PATCH] D18810: [Clang-tidy] Fix readability-static-definition-in-anonymous-namespace warnings; other minor fixes.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 06:43:48 PDT 2016


alexfh added a comment.

Please regenerate the patch with the full context.


================
Comment at: clang-tidy/ClangTidy.cpp:39
@@ -38,1 +38,3 @@
 #include "clang/Tooling/Tooling.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
----------------
Did you make these changes automatically or use IWYU or a similar tool?

================
Comment at: clang-tidy/ClangTidy.cpp:58
@@ -56,2 +57,3 @@
 
-static const StringRef StaticAnalyzerChecks[] = {
+const char *AnalyzerCheckNamePrefix = "clang-analyzer-";
+
----------------
Please also make it `const char *const` or even better `const char X[] = `.

================
Comment at: clang-tidy/misc/DanglingHandleCheck.cpp:32
@@ -27,3 +31,3 @@
   std::vector<std::string> Result;
-  for (StringRef &Class : Classes) {
+  for (auto &Class : Classes) {
     Class = Class.trim();
----------------
I'd prefer this to remain `StringRef &`. The type name is short and it's good to be able to see that it's not `std::string &`, for example.


Repository:
  rL LLVM

http://reviews.llvm.org/D18810





More information about the cfe-commits mailing list