Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.

llvm-svn: 71643
This commit is contained in:
Chris Lattner
2009-05-13 06:10:29 +00:00
parent c898a68998
commit ff96dd0301
2 changed files with 9 additions and 3 deletions

View File

@@ -1631,7 +1631,7 @@ LexNextToken:
// it's actually the start of a preprocessing directive. Callback to
// the preprocessor to handle it.
// FIXME: -fpreprocessed mode??
if (Result.isAtStartOfLine() && !LexingRawMode) {
if (Result.isAtStartOfLine() && !LexingRawMode && !Is_PragmaLexer) {
FormTokenWithChars(Result, CurPtr, tok::hash);
PP->HandleDirective(Result);
@@ -1762,7 +1762,7 @@ LexNextToken:
// it's actually the start of a preprocessing directive. Callback to
// the preprocessor to handle it.
// FIXME: -fpreprocessed mode??
if (Result.isAtStartOfLine() && !LexingRawMode) {
if (Result.isAtStartOfLine() && !LexingRawMode && !Is_PragmaLexer) {
FormTokenWithChars(Result, CurPtr, tok::hash);
PP->HandleDirective(Result);

View File

@@ -1,4 +1,10 @@
// RUN: clang-cc %s -E -verify
// RUN: clang-cc %s -verify -Wall
_Pragma ("GCC system_header") // expected-warning {{system_header ignored in main file}}
// rdar://6880630
_Pragma("#define macro") // expected-warning {{unknown pragma ignored}}
#ifdef macro
#error #define invalid
#endif