From 30b55dc946e01c450d68ff8a6f23c64500329558 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 19 Apr 2009 07:32:03 +0000 Subject: invalid directives can occur in #if 0 code, just pass them through like other directives PTH doesn't care about. This should fix rdar://6804029 llvm-svn: 69524 --- clang/tools/clang-cc/CacheTokens.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/tools/clang-cc/CacheTokens.cpp') diff --git a/clang/tools/clang-cc/CacheTokens.cpp b/clang/tools/clang-cc/CacheTokens.cpp index c417eb49028..2b08818f8f6 100644 --- a/clang/tools/clang-cc/CacheTokens.cpp +++ b/clang/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: { -- cgit v1.2.3