diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-14 22:19:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-14 22:19:45 +0000 |
commit | 1864f2eb59471d07db51adfc3e5b1a229eed631a (patch) | |
tree | 0fee5a041932fe59f68dd0d10e8e90fa8a7b50d2 /lib/Basic/Diagnostic.cpp | |
parent | 6cd1e7cb04d1da66e8b5675062152ff60bbc354f (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/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index bd1d6e8b70..755fbed66f 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -227,6 +227,7 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) { NumWarnings = 0; NumErrors = 0; + NumErrorsSuppressed = 0; CustomDiagInfo = 0; CurDiagID = ~0U; LastDiagLevel = Ignored; @@ -537,8 +538,14 @@ bool Diagnostic::ProcessDiag() { // If a fatal error has already been emitted, silence all subsequent // diagnostics. - if (FatalErrorOccurred) + if (FatalErrorOccurred) { + if (DiagLevel >= Diagnostic::Error) { + ++NumErrors; + ++NumErrorsSuppressed; + } + return false; + } // If the client doesn't care about this message, don't issue it. If this is // a note and the last real diagnostic was ignored, ignore it too. |