diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /lib/Lex/Pragma.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r-- | lib/Lex/Pragma.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 5eb6655..3134790 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -38,7 +38,7 @@ PragmaHandler::~PragmaHandler() { // EmptyPragmaHandler Implementation. //===----------------------------------------------------------------------===// -EmptyPragmaHandler::EmptyPragmaHandler() {} +EmptyPragmaHandler::EmptyPragmaHandler(StringRef Name) : PragmaHandler(Name) {} void EmptyPragmaHandler::HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, @@ -191,9 +191,13 @@ void Preprocessor::Handle_Pragma(Token &Tok) { Lex(Tok); if (!tok::isStringLiteral(Tok.getKind())) { Diag(PragmaLoc, diag::err__Pragma_malformed); - // Skip this token, and the ')', if present. + // Skip bad tokens, and the ')', if present. if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::eof)) Lex(Tok); + while (Tok.isNot(tok::r_paren) && + !Tok.isAtStartOfLine() && + Tok.isNot(tok::eof)) + Lex(Tok); if (Tok.is(tok::r_paren)) Lex(Tok); return _PragmaLexing.failed(); |