Go to file
Hans Wennborg 8f62c5ca22 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.

llvm-svn: 181880
2013-05-15 11:03:04 +00:00
clang Better diagnostics for string initialization. 2013-05-15 11:03:04 +00:00
clang-tools-extra cpp11-migrate: Add override specifier before comments on inline methods 2013-05-14 17:34:12 +00:00
compiler-rt [sanitizer] Fix Android build. 2013-05-14 15:22:39 +00:00
debuginfo-tests Remove IR scenario tests. 2013-03-15 20:52:10 +00:00
libclc Update the copyright coredits -- Happy new year 2013! 2013-01-01 10:00:19 +00:00
libcxx Fixing the MSan/compiler-rt build 2013-05-13 21:53:44 +00:00
libcxxabi Add capability to demangle invocation functions for ObjC blocks. 2013-04-10 19:44:03 +00:00
lld [lld] Fix compiler warning that shift count is too big on P64. 2013-05-14 23:51:50 +00:00
lldb Only include under arm and an Apple system. Otherwise, it will fail under a GNU/Linux under ARM 2013-05-15 09:32:35 +00:00
llvm [SystemZ] Consolidate disassembler tests for valid input into 2 big tests 2013-05-15 11:00:31 +00:00
polly Sort includes 2013-05-07 08:11:54 +00:00