diff options
| author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-03-07 10:13:50 +0000 |
|---|---|---|
| committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-03-07 10:13:50 +0000 |
| commit | 878271b2945e89b868fb8daefea3dfaffce32710 (patch) | |
| tree | f0f94102c32dede3e59498b4ed18d9db3d8fa1eb /clang/lib | |
| parent | fd4156ed4d30828fbcca7b42618dde0550c9b674 (diff) | |
| download | bcm5719-llvm-878271b2945e89b868fb8daefea3dfaffce32710.tar.gz bcm5719-llvm-878271b2945e89b868fb8daefea3dfaffce32710.zip | |
[libclang] Fix CXTranslationUnit_KeepGoing
Since
commit 56f548bbbb7e4387a69708f70724d00e9e076153
[modules] Round-trip -Werror flag through explicit module build.
the behavior of CXTranslationUnit_KeepGoing changed:
Unresolved #includes are fatal errors again. As a consequence, some
templates are not instantiated and lead to confusing errors.
Revert to the old behavior: With CXTranslationUnit_KeepGoing fatal
errors are mapped to errors.
Patch by Nikolai Kosjar.
Differential Revision: https://reviews.llvm.org/D58501
llvm-svn: 355586
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index a7473d8bb5d..e8a99d08a91 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -481,6 +481,11 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, Result = diag::Severity::Fatal; } + // If explicitly requested, map fatal errors to errors. + if (Result == diag::Severity::Fatal && + Diag.CurDiagID != diag::fatal_too_many_errors && Diag.FatalsAsError) + Result = diag::Severity::Error; + // Custom diagnostics always are emitted in system headers. bool ShowInSystemHeader = !GetDiagInfo(DiagID) || GetDiagInfo(DiagID)->WarnShowInSystemHeader; @@ -660,7 +665,7 @@ bool DiagnosticIDs::ProcessDiag(DiagnosticsEngine &Diag) const { // If a fatal error has already been emitted, silence all subsequent // diagnostics. - if (Diag.FatalErrorOccurred && Diag.SuppressAfterFatalError) { + if (Diag.FatalErrorOccurred) { if (DiagLevel >= DiagnosticIDs::Error && Diag.Client->IncludeInDiagnosticCounts()) { ++Diag.NumErrors; |

