xref: /llvm-project/clang/test/Sema/warn-write-strings.c (revision aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7)
1 // RUN: %clang_cc1 -verify -fsyntax-only -fconst-strings %s
2 
3 // PR4804
4 char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char[4]' discards qualifiers}}
5 
6 // PR7192
7 #include <stddef.h>
test(wchar_t * dst)8 void test(wchar_t *dst) {
9   dst[0] = 0;  // Ok.
10 }
11