[PATCH] D15528: Teach clang-tidy how to -Werror checks.

Jonathan Roelofs via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 15 08:46:41 PST 2015


jroelofs added inline comments.

================
Comment at: tools/llvm-project/extra/clang-tidy/ClangTidy.cpp:119
@@ +118,3 @@
+      if (Error.IsWError) {
+        Name += ", -Werrors=";
+        Level = DiagnosticsEngine::Error;
----------------
hardcoding happens here ^

================
Comment at: tools/llvm-project/extra/clang-tidy/ClangTidy.cpp:156
@@ -149,1 +155,3 @@
 
+  unsigned WErrorCount() { return WErrors; }
+
----------------
aaron.ballman wrote:
> Method can be const.
ok

================
Comment at: tools/llvm-project/extra/test/clang-tidy/werrors-plural.cpp:7
@@ +6,3 @@
+// CHECK-WARN: warning: namespace 'j' not terminated with a closing comment [llvm-namespace-comment]
+// CHECK-WERR: error: namespace 'j' not terminated with a closing comment [llvm-namespace-comment, -Werrors=]
+
----------------
aaron.ballman wrote:
> One of these tests should complete the -Werrors= chunk just to be sure it's getting printed properly.
Not sure what you mean here. Should I be printing the -Werrors argument as the user wrote it? (it isn't currently... this is just a hardcoded string).


http://reviews.llvm.org/D15528





More information about the cfe-commits mailing list