diff options
author | Nikolai Kosjar <[email protected]> | 2019-02-20 17:13:14 +0100 |
---|---|---|
committer | Ivan Donchevskii <[email protected]> | 2019-03-07 12:56:01 +0000 |
commit | dba0adcfe0fec308a047cca79b1be0b1436f6fad (patch) | |
tree | cd086e0eba2b36b88d2146e4a90ceab61a52f4f3 /lib/Basic/DiagnosticIDs.cpp | |
parent | d1408d8177f7553097d1efd9d62c75868340266b (diff) |
[backported/clang-9][libclang] Fix CXTranslationUnit_KeepGoingrelease_70-based
--------------------------------------------------------------------------
https://reviews.llvm.org/D58501
--------------------------------------------------------------------------
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.
Subscribers: arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58501
Fixes: QTCREATORBUG-21892
Change-Id: I6b5c2490922a798fcc9080fa73fa1fdaecf7bddd
Reviewed-by: Ivan Donchevskii <[email protected]>
Diffstat (limited to 'lib/Basic/DiagnosticIDs.cpp')
-rw-r--r-- | lib/Basic/DiagnosticIDs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index c50da06d3b..93d13849ba 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -485,6 +485,11 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, return diag::Severity::Ignored; } + // 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; @@ -664,7 +669,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; |