From: Chris Lattner <sabre@nondot.org> Date: Sun, 5 Sep 2010 23:29:49 +0000 (+0000) Subject: fix PR7192 by defining wchar_t in a more conventional way. The X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d6370ee10ddcd8cacc44c2d6796800c1325c732;p=clang fix PR7192 by defining wchar_t in a more conventional way. The type of L"x" can change based on command line arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113127 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h index fdd48159ba..84ec1a7b4e 100644 --- a/lib/Headers/stddef.h +++ b/lib/Headers/stddef.h @@ -34,7 +34,7 @@ typedef __typeof__(sizeof(int)) size_t; #ifndef __cplusplus #ifndef _WCHAR_T #define _WCHAR_T -typedef __typeof__(*L"") wchar_t; +typedef __WCHAR_TYPE__ wchar_t; #endif #endif diff --git a/test/Sema/warn-write-strings.c b/test/Sema/warn-write-strings.c index 450d0a6fe6..dd0bb8a6d8 100644 --- a/test/Sema/warn-write-strings.c +++ b/test/Sema/warn-write-strings.c @@ -2,3 +2,9 @@ // PR4804 char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}} + +// PR7192 +#include <stddef.h> +void test(wchar_t *dst) { + dst[0] = 0; // Ok. +}