aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-17 23:56:52 +0000
committerChris Lattner <sabre@nondot.org>2009-04-17 23:56:52 +0000
commit9cb51ce03caf0755759f7e67aea7d4be684ff738 (patch)
tree0e85f2f223acdb166a1e01e848da57b4db47887f /lib/Lex/PPDirectives.cpp
parent58e91d57510a5ce4fd424fe7fd1cdfa86701ef35 (diff)
Fix two problems from PR3916, and one problem I noticed while hacking
on the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 2dfb6233bd..502da73842 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -1066,8 +1066,11 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok,
return;
}
- // Verify that there is nothing after the filename, other than EOM.
- CheckEndOfDirective(IncludeTok.getIdentifierInfo()->getName());
+ // Verify that there is nothing after the filename, other than EOM. Note that
+ // we allow macros that expand to nothing after the filename, because this
+ // falls into the category of "#include pp-tokens new-line" specified in
+ // C99 6.10.2p4.
+ CheckEndOfDirective(IncludeTok.getIdentifierInfo()->getName(), true);
// Check that we don't have infinite #include recursion.
if (IncludeMacroStack.size() == MaxAllowedIncludeStackDepth-1) {