aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-14 22:19:45 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-14 22:19:45 +0000
commit1864f2eb59471d07db51adfc3e5b1a229eed631a (patch)
tree0fee5a041932fe59f68dd0d10e8e90fa8a7b50d2 /lib/Frontend/CompilerInstance.cpp
parent6cd1e7cb04d1da66e8b5675062152ff60bbc354f (diff)
Once we've emitted a fatal diagnostic, keep counting errors but with a
separate count of "suppressed" errors. This way, semantic analysis bits that depend on the error count to determine whether problems occured (e.g., some template argument deduction failures, jump-scope checking) will not get confused. The actual problem here is that a missing #include (which is a fatal error) could cause the jump-scope checker to run on invalid code, which it is not prepared to do. Trivial fix for both <rdar://problem/7775941> and <rdar://problem/7775709>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 685e6c281c..5ed9c409a3 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -515,7 +515,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
if (getDiagnosticOpts().ShowCarets) {
unsigned NumWarnings = getDiagnostics().getNumWarnings();
- unsigned NumErrors = getDiagnostics().getNumErrors();
+ unsigned NumErrors = getDiagnostics().getNumErrors() -
+ getDiagnostics().getNumErrorsSuppressed();
if (NumWarnings)
OS << NumWarnings << " warning" << (NumWarnings == 1 ? "" : "s");