[clang-tools-extra] r222427 - [clang-tidy] Count errors in ClangTidyDiagnosticConsumer

Alexander Kornienko alexfh at google.com
Thu Nov 20 04:05:51 PST 2014


Author: alexfh
Date: Thu Nov 20 06:05:51 2014
New Revision: 222427

URL: http://llvm.org/viewvc/llvm-project?rev=222427&view=rev
Log:
[clang-tidy] Count errors in ClangTidyDiagnosticConsumer

This re-applies r222363 reverted in r222390 after compilation errors in our
out-of-tree clang-tidy tests were fixed.

Modified:
    clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=222427&r1=222426&r2=222427&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Thu Nov 20 06:05:51 2014
@@ -277,6 +277,9 @@ void ClangTidyDiagnosticConsumer::finali
 
 void ClangTidyDiagnosticConsumer::HandleDiagnostic(
     DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {
+  // Count warnings/errors.
+  DiagnosticConsumer::HandleDiagnostic(DiagLevel, Info);
+
   if (DiagLevel == DiagnosticsEngine::Note) {
     assert(!Errors.empty() &&
            "A diagnostic note can only be appended to a message.");

Modified: clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp?rev=222427&r1=222426&r2=222427&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp Thu Nov 20 06:05:51 2014
@@ -6,7 +6,7 @@ struct A {
   virtual void f() {}
   virtual void g() {}
 };
-// CHECK-NOT: warning
+// CHECK-NOT: warning:
 struct B : public A {
   void placeholder_for_f() {}
 // CHECK-SANITY: [[@LINE-1]]:8: warning: Annotate this





More information about the cfe-commits mailing list