From 0f12507d43c2571108c65f106c1dac5bba2509f0 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 25 Jan 2012 22:34:12 +0000 Subject: [PATCH] Improve the error message slightly for files that aren't using the expected UTF-8 encoding. Patch by Seth Cantrell. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148991 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticLexKinds.td | 4 ++-- test/Lexer/char-literal-encoding-error.c | 8 ++++---- test/Lexer/string-literal-encoding.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 547f2722c0..936a72e8e7 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -133,9 +133,9 @@ def warn_cxx98_compat_unicode_literal : Warning< def err_unsupported_string_concat : Error< "unsupported non-standard concatenation of string literals">; def err_bad_string_encoding : Error< - "illegal sequence in string literal">; + "illegal character encoding in string literal">; def err_bad_character_encoding : Error< - "illegal sequence in character literal">; + "illegal character encoding in character literal">; //===----------------------------------------------------------------------===// // PTH Diagnostics diff --git a/test/Lexer/char-literal-encoding-error.c b/test/Lexer/char-literal-encoding-error.c index 08f9a50a0d..833ffcaa25 100644 --- a/test/Lexer/char-literal-encoding-error.c +++ b/test/Lexer/char-literal-encoding-error.c @@ -3,8 +3,8 @@ // This file is encoded using ISO-8859-1 int main() { - 'é'; // expected-error {{illegal sequence in character literal}} - u'é'; // expected-error {{illegal sequence in character literal}} - U'é'; // expected-error {{illegal sequence in character literal}} - L'é'; // expected-error {{illegal sequence in character literal}} + 'é'; // expected-error {{illegal character encoding in character literal}} + u'é'; // expected-error {{illegal character encoding in character literal}} + U'é'; // expected-error {{illegal character encoding in character literal}} + L'é'; // expected-error {{illegal character encoding in character literal}} } diff --git a/test/Lexer/string-literal-encoding.c b/test/Lexer/string-literal-encoding.c index c92f7bbe4b..b12cfab156 100644 --- a/test/Lexer/string-literal-encoding.c +++ b/test/Lexer/string-literal-encoding.c @@ -5,11 +5,11 @@ // U+00F5 U+00FC void f() { - wchar_t const *a = L"Àéîõü"; // expected-error {{illegal sequence in string literal}} + wchar_t const *a = L"Àéîõü"; // expected-error {{illegal character encoding in string literal}} - char16_t const *b = u"Àéîõü"; // expected-error {{illegal sequence in string literal}} - char32_t const *c = U"Àéîõü"; // expected-error {{illegal sequence in string literal}} - wchar_t const *d = LR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}} - char16_t const *e = uR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}} - char32_t const *f = UR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}} + char16_t const *b = u"Àéîõü"; // expected-error {{illegal character encoding in string literal}} + char32_t const *c = U"Àéîõü"; // expected-error {{illegal character encoding in string literal}} + wchar_t const *d = LR"(Àéîõü)"; // expected-error {{illegal character encoding in string literal}} + char16_t const *e = uR"(Àéîõü)"; // expected-error {{illegal character encoding in string literal}} + char32_t const *f = UR"(Àéîõü)"; // expected-error {{illegal character encoding in string literal}} } -- 2.40.0