From 193f185902f185d9d9bfe224b7a046b18c7bb8fd Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 14 Apr 2008 19:56:12 +0000 Subject: [PATCH] Only increment the number of diagnostics when the DiagnosticClient used is the one attached to the Diagnostic object. llvm-svn: 49677 --- clang/lib/Basic/Diagnostic.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 867b3dbec1a7..77984d6a0995 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -221,7 +221,9 @@ void Diagnostic::Report(DiagnosticClient* C, if (DiagLevel >= Diagnostic::Error) { ErrorOccurred = true; - ++NumErrors; + + if (C == &Client) + ++NumErrors; } // Finally, report it. @@ -230,7 +232,9 @@ void Diagnostic::Report(DiagnosticClient* C, C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID, Strs, NumStrs, Ranges, NumRanges); - ++NumDiagnostics; + + if (C == &Client) + ++NumDiagnostics; } DiagnosticClient::~DiagnosticClient() {}