summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-06-16 05:05:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-06-16 05:05:39 +0000
commit089ee1554c74f12bba8dddcf14cb62feeab6a08b (patch)
tree00695efe860dde80d995150888617c78b2fbcce7 /clang/lib/Lex/PPDirectives.cpp
parentd1336faf53fc83d84da01be3d0d7e9ec5e47e9c8 (diff)
downloadbcm5719-llvm-089ee1554c74f12bba8dddcf14cb62feeab6a08b.tar.gz
bcm5719-llvm-089ee1554c74f12bba8dddcf14cb62feeab6a08b.zip
PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'
and a '!defined(X)' if we find a broken header guard. This is suboptimal; we should point the diagnostic at the 'X' token not the 'if' token, but it fixes the crash. llvm-svn: 184054
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 0cfdac92d23..3e3312a9261 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -2132,7 +2132,8 @@ void Preprocessor::HandleIfDirective(Token &IfToken,
// directive seen, handle it for the multiple-include optimization.
if (CurPPLexer->getConditionalStackDepth() == 0) {
if (!ReadAnyTokensBeforeDirective && IfNDefMacro && ConditionalTrue)
- CurPPLexer->MIOpt.EnterTopLevelIfndef(IfNDefMacro, ConditionalBegin);
+ // FIXME: Pass in the location of the macro name, not the 'if' token.
+ CurPPLexer->MIOpt.EnterTopLevelIfndef(IfNDefMacro, IfToken.getLocation());
else
CurPPLexer->MIOpt.EnterTopLevelConditional();
}
OpenPOWER on IntegriCloud