aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/clang-cc/CacheTokens.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/clang-cc/CacheTokens.cpp b/tools/clang-cc/CacheTokens.cpp
index c417eb4902..2b08818f8f 100644
--- a/tools/clang-cc/CacheTokens.cpp
+++ b/tools/clang-cc/CacheTokens.cpp
@@ -490,12 +490,15 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) {
Tok.setIdentifierInfo(II);
tok::PPKeywordKind K = II->getPPKeywordID();
- assert(K != tok::pp_not_keyword);
ParsingPreprocessorDirective = true;
switch (K) {
+ case tok::pp_not_keyword:
+ // Invalid directives "#foo" can occur in #if 0 blocks etc, just pass
+ // them through.
default:
break;
+
case tok::pp_include:
case tok::pp_import:
case tok::pp_include_next: {