From: Chris Lattner Date: Thu, 30 Aug 2007 06:34:23 +0000 (+0000) Subject: When relexing the file to find expected warnings/errors, make sure X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f01654f98dd4a7177f670b4fa08ee4a2e3efbe26;p=clang When relexing the file to find expected warnings/errors, make sure to turn off all lexer-related warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41604 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp index 1e327ce363..e2efd96cce 100644 --- a/Driver/DiagChecker.cpp +++ b/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);