[clang-tidy] Count errors in ClangTidyDiagnosticConsumer
authorAlexander Kornienko <alexfh@google.com>
Thu, 20 Nov 2014 12:05:51 +0000 (12:05 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 20 Nov 2014 12:05:51 +0000 (12:05 +0000)
This re-applies r222363 reverted in r222390 after compilation errors in our
out-of-tree clang-tidy tests were fixed.

llvm-svn: 222427

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp

index 06e0e3f..ad341ce 100644 (file)
@@ -277,6 +277,9 @@ void ClangTidyDiagnosticConsumer::finalizeLastError() {
 
 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.");
index 205c002..4b32852 100644 (file)
@@ -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