summaryrefslogtreecommitdiffstats
path: root/clang/Driver/DiagChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Driver/DiagChecker.cpp')
-rw-r--r--clang/Driver/DiagChecker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/Driver/DiagChecker.cpp b/clang/Driver/DiagChecker.cpp
index 1e327ce363d..e2efd96cce9 100644
--- a/clang/Driver/DiagChecker.cpp
+++ b/clang/Driver/DiagChecker.cpp
@@ -91,6 +91,13 @@ static void FindExpectedDiags(Preprocessor &PP, unsigned MainFileID,
// Enter the cave.
PP.EnterSourceFile(MainFileID, 0, true);
+ // Turn off all warnings from relexing or preprocessing.
+ PP.getDiagnostics().setWarnOnExtensions(false);
+ PP.getDiagnostics().setErrorOnExtensions(false);
+ for (unsigned i = 0; i != diag::NUM_DIAGNOSTICS; ++i)
+ if (PP.getDiagnostics().isNoteWarningOrExtension((diag::kind)i))
+ PP.getDiagnostics().setDiagnosticMapping((diag::kind)i, diag::MAP_IGNORE);
+
Token Tok;
do {
PP.Lex(Tok);
OpenPOWER on IntegriCloud