History log of /external/clang/test/Lexer/char-literal.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0ff5074f37a66bca244a9d5d0da050ff68693ce2 15-May-2013 Hans Wennborg <hans@hanshq.net> Better diagnostics for string initialization.

This commit improves Clang's diagnostics for string initialization.
Where it would previously say:

/tmp/a.c:3:9: error: array initializer must be an initializer list
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: array initializer must be an initializer list or string literal
char t[] = L"Hi";
^

It will now say

/tmp/a.c:3:9: error: initializing wide char array with non-wide string literal
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: initializing char array with wide string literal
char t[] = L"Hi";
^

As a bonus, it also fixes the fact that Clang would previously reject
this valid C11 code:

char16_t s[] = u"hi";
char32_t t[] = U"hi";

because it would only recognize the built-in types for char16_t and
char32_t, which do not exist in C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Lexer/char-literal.cpp
0093e12513c5c896434915d5e9126f51b780aa61 10-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> When lexing in C11 mode, accept unicode character and string literals, per C11
6.4.4.4/1 and 6.4.5/1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Lexer/char-literal.cpp
59b26d84b64510158e23d80eba077b844b7e0b04 13-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix off-by-one error in UTF-16 encoding: don't try to use a surrogate pair for U+FFFF.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Lexer/char-literal.cpp
7748cbc97ff9c6c3940549d30965a10b47a45ee8 18-Jan-2012 Seth Cantrell <seth.cantrell@gmail.com> Add and update tests for character literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Lexer/char-literal.cpp