diff options
Diffstat (limited to 'lib/Lex/PPMacroExpansion.cpp')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 3de6cdb39d..1b8fcbac33 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -985,8 +985,14 @@ static bool EvaluateHasIncludeCommon(Token &Tok, // Save '(' location for possible missing ')' message. LParenLoc = Tok.getLocation(); - // Get the file name. - PP.getCurrentLexer()->LexIncludeFilename(Tok); + if (PP.getCurrentLexer()) { + // Get the file name. + PP.getCurrentLexer()->LexIncludeFilename(Tok); + } else { + // We're in a macro, so we can't use LexIncludeFilename; just + // grab the next token. + PP.Lex(Tok); + } } // Reserve a buffer to get the spelling. |