diff options
| -rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 4ab293b9b72..1c8f7f1f3a3 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -629,10 +629,12 @@ void Preprocessor::HandleLineDirective(Token &Tok) {    // FIXME: do something with the #line info.  } - +/// HandleUserDiagnosticDirective - Handle a #warning or #error directive. +///  void Preprocessor::HandleUserDiagnosticDirective(Token &Tok,                                                    bool isWarning) { -  if (!CurLexer) +  // PTH doesn't emit #warning or #error directives. +  if (CurPTHLexer)      return CurPTHLexer->DiscardToEndOfLine();    // Read the rest of the line raw.  We do this because we don't want macros @@ -661,6 +663,8 @@ void Preprocessor::HandleIdentSCCSDirective(Token &Tok) {    if (StrTok.isNot(tok::string_literal) &&        StrTok.isNot(tok::wide_string_literal)) {      Diag(StrTok, diag::err_pp_malformed_ident); +    if (StrTok.isNot(tok::eom)) +      DiscardUntilEndOfDirective();      return;    } | 

