]> granicus.if.org Git - clang/commitdiff
fix PR7192 by defining wchar_t in a more conventional way. The
authorChris Lattner <sabre@nondot.org>
Sun, 5 Sep 2010 23:29:49 +0000 (23:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 5 Sep 2010 23:29:49 +0000 (23:29 +0000)
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

lib/Headers/stddef.h
test/Sema/warn-write-strings.c

index fdd48159bab6f5204ad9f15f62a900aaf5897e44..84ec1a7b4e24a14fca53688e25a90c1cc8305b8c 100644 (file)
@@ -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
 
index 450d0a6fe62e64115df318b1e4f06be66dcd7174..dd0bb8a6d83a486e4c003dac8011005a54bc7ae2 100644 (file)
@@ -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.
+}