mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-15 23:40:54 +00:00
Warn for missing terminating " or ' instead of error for gcc compatibility. Fixed rdar://8914293.
llvm-svn: 125616
This commit is contained in:
parent
49e3348e56
commit
c541ade850
@ -45,8 +45,8 @@ def charize_microsoft_ext : Extension<"@# is a microsoft extension">;
|
||||
|
||||
def ext_token_used : Extension<"extension used">;
|
||||
|
||||
def err_unterminated_string : Error<"missing terminating '\"' character">;
|
||||
def err_unterminated_char : Error<"missing terminating ' character">;
|
||||
def warn_unterminated_string : Warning<"missing terminating '\"' character">;
|
||||
def warn_unterminated_char : Warning<"missing terminating ' character">;
|
||||
def err_empty_character : Error<"empty character constant">;
|
||||
def err_unterminated_block_comment : Error<"unterminated /* comment">;
|
||||
def err_invalid_character_to_charify : Error<
|
||||
|
@ -1162,7 +1162,7 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr, bool Wide) {
|
||||
if (C == 0 && PP && PP->isCodeCompletionFile(FileLoc))
|
||||
PP->CodeCompleteNaturalLanguage();
|
||||
else if (!isLexingRawMode() && !Features.AsmPreprocessor)
|
||||
Diag(BufferPtr, diag::err_unterminated_string);
|
||||
Diag(BufferPtr, diag::warn_unterminated_string);
|
||||
FormTokenWithChars(Result, CurPtr-1, tok::unknown);
|
||||
return;
|
||||
}
|
||||
@ -1241,7 +1241,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr) {
|
||||
if (C == 0 && PP && PP->isCodeCompletionFile(FileLoc))
|
||||
PP->CodeCompleteNaturalLanguage();
|
||||
else if (!isLexingRawMode() && !Features.AsmPreprocessor)
|
||||
Diag(BufferPtr, diag::err_unterminated_char);
|
||||
Diag(BufferPtr, diag::warn_unterminated_char);
|
||||
FormTokenWithChars(Result, CurPtr-1, tok::unknown);
|
||||
return;
|
||||
} else if (C == 0) {
|
||||
|
7
clang/test/Lexer/rdar-8914293.c
Normal file
7
clang/test/Lexer/rdar-8914293.c
Normal file
@ -0,0 +1,7 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
// rdar://8914293
|
||||
// We want be compatible with gcc and warn, not error.
|
||||
|
||||
/* expected-warning {{missing terminating}} */ #define FOO "foo
|
||||
/* expected-warning {{missing terminating}} */ #define KOO 'k
|
Loading…
x
Reference in New Issue
Block a user