summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-05 23:29:49 +0000
committerChris Lattner <sabre@nondot.org>2010-09-05 23:29:49 +0000
commitee8df8f1678de51cfc38014c61dc0624805bbe0a (patch)
tree9071b15f93f444d74a3a349db31b17b8d6ccdf8c
parent2ba828f36ddad474c984992bde793211746ba8c8 (diff)
downloadbcm5719-llvm-ee8df8f1678de51cfc38014c61dc0624805bbe0a.tar.gz
bcm5719-llvm-ee8df8f1678de51cfc38014c61dc0624805bbe0a.zip
fix PR7192 by defining wchar_t in a more conventional way. The
type of L"x" can change based on command line arguments. llvm-svn: 113127
-rw-r--r--clang/lib/Headers/stddef.h2
-rw-r--r--clang/test/Sema/warn-write-strings.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Headers/stddef.h b/clang/lib/Headers/stddef.h
index fdd48159bab..84ec1a7b4e2 100644
--- a/clang/lib/Headers/stddef.h
+++ b/clang/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/clang/test/Sema/warn-write-strings.c b/clang/test/Sema/warn-write-strings.c
index 450d0a6fe62..dd0bb8a6d83 100644
--- a/clang/test/Sema/warn-write-strings.c
+++ b/clang/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.
+}
OpenPOWER on IntegriCloud