summaryrefslogtreecommitdiffstats
path: root/clang/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
commitb40289b2b8453e22869928540c2978d8ffd6d74e (patch)
treeb70f761856dbaaf9e95a450eb22ee22928a69b64 /clang/lib/Lex/PPDirectives.cpp
parentca556cb3e3658637fc1eb3ff68bf348041ac959d (diff)
downloadbcm5719-llvm-b40289b2b8453e22869928540c2978d8ffd6d74e.tar.gz
bcm5719-llvm-b40289b2b8453e22869928540c2978d8ffd6d74e.zip
Fix two problems from PR3916, and one problem I noticed while hacking
on the code. llvm-svn: 69404
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 2dfb6233bdf..502da738425 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud