зеркало из https://github.com/microsoft/clang.git
Fix diagnostic for reporting bad escape sequence.
Patch by Paul Curtis! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
8c00ad1e38
Коммит
23ef69d197
|
@ -151,7 +151,7 @@ static unsigned ProcessCharEscape(const char *&ThisTokBuf,
|
|||
if (Diags == 0)
|
||||
break;
|
||||
|
||||
if (isgraph(ThisTokBuf[0]))
|
||||
if (isgraph(ResultChar))
|
||||
Diags->Report(Loc, diag::ext_unknown_escape)
|
||||
<< std::string()+(char)ResultChar;
|
||||
else
|
||||
|
|
|
@ -19,3 +19,4 @@ int test['\(' == 40 ? 1 : -1]; // expected-warning {{non-standard escape}}
|
|||
int test['\{' == 123 ? 1 : -1]; // expected-warning {{non-standard escape}}
|
||||
int test['\[' == 91 ? 1 : -1]; // expected-warning {{non-standard escape}}
|
||||
int test['\%' == 37 ? 1 : -1]; // expected-warning {{non-standard escape}}
|
||||
const char *format = "abc \m def"; // expected-warning{{unknown escape sequence '\m'}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче