aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Headers/stddef.h2
-rw-r--r--test/Sema/warn-write-strings.c6
2 files changed, 7 insertions, 1 deletions
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.
+}