diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index dafbef1824b..152dd6d5b6b 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -553,9 +553,10 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { } if (getDiagnosticOpts().ShowCarets) { - unsigned NumWarnings = getDiagnostics().getNumWarnings(); - unsigned NumErrors = getDiagnostics().getNumErrors() - - getDiagnostics().getNumErrorsSuppressed(); + // We can have multiple diagnostics sharing one diagnostic client. + // Get the total number of warnings/errors from the client. + unsigned NumWarnings = getDiagnostics().getClient()->getNumWarnings(); + unsigned NumErrors = getDiagnostics().getClient()->getNumErrors(); if (NumWarnings) OS << NumWarnings << " warning" << (NumWarnings == 1 ? "" : "s"); |

