Do not return early if the "{" is in a CPP macro!

This commit is contained in:
Axel Naumann 2016-07-29 16:45:20 +02:00 committed by sftnight
parent 928983b710
commit 40b24434be

View File

@ -77,10 +77,6 @@ cling::utils::isUnnamedMacro(llvm::StringRef source,
bool AfterHash = false;
while (true) {
bool atEOF = Lex.Lex(Tok);
const tok::TokenKind kind = Tok.getKind();
if (kind == tok::l_brace)
return getFileOffset(Tok);
if (atEOF)
return std::string::npos;
@ -106,7 +102,10 @@ cling::utils::isUnnamedMacro(llvm::StringRef source,
continue; // Skip PP directives.
}
if (kind == tok::comment)
if (Tok.is(tok::l_brace))
return getFileOffset(Tok);
if (Tok.is(tok::comment))
continue; // ignore comments
return std::string::npos;