]> granicus.if.org Git - clang/commitdiff
invalid directives can occur in #if 0 code, just pass them
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 07:32:03 +0000 (07:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 07:32:03 +0000 (07:32 +0000)
through like other directives PTH doesn't care about.  This
should fix rdar://6804029

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69524 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/CacheTokens.cpp

index c417eb490285a23e99ebfb1aefabacf0f4faab46..2b08818f8f67ea8ea5560032f33a6f5d9117ce91 100644 (file)
@@ -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: {