mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 23:31:50 +08:00
Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
llvm-svn: 71643
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user