]> granicus.if.org Git - clang/commitdiff
Improve diagnostics like "initializing <type> from an expression of
authorDouglas Gregor <dgregor@apple.com>
Fri, 9 Apr 2010 17:53:29 +0000 (17:53 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 9 Apr 2010 17:53:29 +0000 (17:53 +0000)
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100873 91177308-0d34-0410-b5e6-96231b3b80d8

19 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
test/FixIt/fixit-objc.m
test/PCH/types.c
test/Sema/anonymous-struct-union.c
test/Sema/array-init.c
test/Sema/block-call.c
test/Sema/block-return.c
test/Sema/cast-to-union.c
test/Sema/compound-literal.c
test/Sema/enum.c
test/Sema/invalid-init-diag.c
test/Sema/predef.c
test/Sema/struct-compat.c
test/Sema/warn-write-strings.c
test/SemaObjC/comptypes-6.m
test/SemaObjC/conditional-expr-3.m
test/SemaObjC/conditional-expr-4.m
test/SemaObjC/message.m
test/SemaObjC/warn-write-strings.m

index 27632f171fbc0c713b97ce39a463e1434b5ca075..62769decf484ec9dca0d30d568118aba0e16101c 100644 (file)
@@ -2233,38 +2233,38 @@ def err_typecheck_convert_incompatible : Error<
   " %0 "
   "%select{from incompatible type|to parameter of incompatible type|"
   "from a function with incompatible result type|to incompatible type|"
-  "from an expression of incompatible type|to parameter of incompatible type|"
+  "with an expression of incompatible type|to parameter of incompatible type|"
   "to incompatible type}2 %1">;
 def warn_incompatible_qualified_id : Warning<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from incompatible type|to parameter of incompatible type|"
   "from a function with incompatible result type|to incompatible type|"
-  "from an expression of incompatible type|to parameter of incompatible type|"
+  "with an expression of incompatible type|to parameter of incompatible type|"
   "to incompatible type}2 %1">;
 def ext_typecheck_convert_pointer_int : ExtWarn<
   "incompatible pointer to integer conversion "
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">;
+  "with an expression of type|to parameter of type|to type}2 %1">;
 def ext_typecheck_convert_int_pointer : ExtWarn<
   "incompatible integer to pointer conversion "
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">;
+  "with an expression of type|to parameter of type|to type}2 %1">;
 def ext_typecheck_convert_pointer_void_func : Extension<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1 "
+  "with an expression of type|to parameter of type|to type}2 %1 "
   "converts between void pointer and function pointer">;
 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1 "
+  "with an expression of type|to parameter of type|to type}2 %1 "
   "converts between pointers to integer types with different sign">,
   InGroup<DiagGroup<"pointer-sign">>;
 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
@@ -2272,38 +2272,38 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">;
+  "with an expression of type|to parameter of type|to type}2 %1">;
 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1 discards "
+  "with an expression of type|to parameter of type|to type}2 %1 discards "
   "qualifiers">;
 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1 discards "
+  "with an expression of type|to parameter of type|to type}2 %1 discards "
   "qualifiers in nested pointer types">;
 def warn_incompatible_vectors : Warning<
   "incompatible vector types "
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">,
+  "with an expression of type|to parameter of type|to type}2 %1">,
   InGroup<VectorConversions>, DefaultIgnore;
 def err_int_to_block_pointer : Error<
   "invalid block pointer conversion "
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">;
+  "with an expression of type|to parameter of type|to type}2 %1">;
 def err_typecheck_convert_incompatible_block_pointer : Error<
   "incompatible block pointer types "
   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
   " %0 "
   "%select{from|to parameter of type|from a function with result type|to type|"
-  "from an expression of type|to parameter of type|to type}2 %1">;
+  "with an expression of type|to parameter of type|to type}2 %1">;
   
 def err_typecheck_convert_ambiguous : Error<
   "ambiguity in initializing value of type %0 with initializer of type %1">;
index 072d50a69b7f0245ce63fac5799f48473b8f617e..6aa1b33ea17c66bfa20ee69f973266c26a5aa785 100644 (file)
@@ -27,7 +27,7 @@ void h(id a);
 void f(Test *t) {
   NSString *a = "Foo";
   id b = "Foo";
-  A* c = "Foo"; // expected-warning {{incompatible pointer types initializing 'A *' from an expression of type 'char [4]'}}
+  A* c = "Foo"; // expected-warning {{incompatible pointer types initializing 'A *' with an expression of type 'char [4]'}}
   g("Foo");
   h("Foo");
   h(("Foo"));
index 5ca6a6893ff158a995befa18b4b2b74bca6620d5..c21b33a4ee519ee28ccec7b8316ea003a1c0cb7a 100644 (file)
@@ -66,7 +66,7 @@ int_ptr_ptr ipp = &int_value_ptr;
 // TYPE_TYPEOF_EXPR
 typeof_17 *t17 = &int_value;
 struct S { int x, y; };
-typeof_17 t17_2 = (struct S){1, 2}; // expected-error{{initializing 'typeof_17' (aka 'int') from an expression of incompatible type 'struct S'}}
+typeof_17 t17_2 = (struct S){1, 2}; // expected-error{{initializing 'typeof_17' (aka 'int') with an expression of incompatible type 'struct S'}}
 
 // TYPE_TYPEOF
 int_ptr_ptr2 ipp2 = &int_value_ptr;
index b91426ca6c17ffd66760aa9749304dcffedc271e..d9e08397f2d38923b522d369ae7e6154ee892863 100644 (file)
@@ -101,4 +101,4 @@ struct s2 {
 typedef struct {
   int x;
 } a_struct;
-int tmp = (a_struct) { .x = 0 }; // expected-error {{initializing 'int' from an expression of incompatible type 'a_struct'}}
+int tmp = (a_struct) { .x = 0 }; // expected-error {{initializing 'int' with an expression of incompatible type 'a_struct'}}
index ac45ff77c8eae410c6cd8028413aad42210e61a7..f93b0878fd3f1ad24fad19b0d735ccc246697381 100644 (file)
@@ -9,7 +9,7 @@ int ary2[] = { x, y, z }; // expected-error{{initializer element is not a compil
 
 extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}}
 
-static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' from an expression of type 'char [4]'}}
+static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
 
 void func() {
   int x = 1;
@@ -44,11 +44,11 @@ void func() {
     int a,b,c;
   } z = { 1 };
 
-  struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'struct threeElements *' from an expression of type 'int'}}
+  struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'struct threeElements *' with an expression of type 'int'}}
   
   extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}}
   
-  static long x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' from an expression of type 'char [4]'}}
+  static long x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
 }
 
 void test() {
@@ -155,10 +155,10 @@ void charArrays() {
   char c[] = { "Hello" };
   int l[sizeof(c) == 6 ? 1 : -1];
   
-  int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' from an expression of type 'char [7]'}}
+  int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [7]'}}
   char c2[] = { "Hello", "Good bye" }; //expected-warning{{excess elements in char array initializer}}
 
-  int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' from an expression of type 'char [6]'}}
+  int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [6]'}}
   char c3[5] = { "Hello" };
   char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}}
 
@@ -191,12 +191,12 @@ void autoStructTest() {
 struct s1 {char a; char b;} t1;
 struct s2 {struct s1 c;} t2 = { t1 };
 // The following is a less than great diagnostic (though it's on par with EDG).
-struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' from an expression of type 'char [4]'}}
+struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [4]'}}
 int t4[sizeof t3 == 6 ? 1 : -1];
 }
 struct foo { int z; } w;
 int bar (void) { 
-  struct foo z = { w }; //expected-error{{initializing 'int' from an expression of incompatible type 'struct foo'}}
+  struct foo z = { w }; //expected-error{{initializing 'int' with an expression of incompatible type 'struct foo'}}
   return z.z; 
 } 
 struct s3 {void (*a)(void);} t5 = {autoStructTest};
index 01906bc4f2f9c381ef615c5fe3bee95373d25471..318bc6b2a3b117acd1ffaa1bc2a9c0119f7d5844 100644 (file)
@@ -13,7 +13,7 @@ int main() {
   int (^IFP) () = PFR; // OK
 
 
-  const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int const (^)()' from an expression of type 'int (^)()'}}
+  const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int const (^)()' with an expression of type 'int (^)()'}}
 
   const int (^CICC) () = CIC;
 
@@ -21,7 +21,7 @@ int main() {
 
   int * const (^IPCC1) () = IPCC;
 
-  int * (^IPCC2) () = IPCC;       // expected-error {{incompatible block pointer types initializing 'int *(^)()' from an expression of type 'int *const (^)()'}}
+  int * (^IPCC2) () = IPCC;       // expected-error {{incompatible block pointer types initializing 'int *(^)()' with an expression of type 'int *const (^)()'}}
 
   int (^IPCC3) (const int) = PFR;
 
@@ -29,14 +29,14 @@ int main() {
 
   int (^IPCC5) (int, char (^CArg) (double)) = IPCC4;
 
-  int (^IPCC6) (int, char (^CArg) (float))  = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(float))' from an expression of type 'int (^)(int, char (^)(double))'}}
+  int (^IPCC6) (int, char (^CArg) (float))  = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(float))' with an expression of type 'int (^)(int, char (^)(double))'}}
 
   IPCC2 = 0;
   IPCC2 = 1; // expected-error {{invalid block pointer conversion assigning to 'int *(^)()' from 'int'}}
   int (^x)() = 0;
-  int (^y)() = 3;   // expected-error {{invalid block pointer conversion initializing 'int (^)()' from an expression of type 'int'}}
+  int (^y)() = 3;   // expected-error {{invalid block pointer conversion initializing 'int (^)()' with an expression of type 'int'}}
   int a = 1;
-  int (^z)() = a+4;   // expected-error {{invalid block pointer conversion initializing 'int (^)()' from an expression of type 'int'}}
+  int (^z)() = a+4;   // expected-error {{invalid block pointer conversion initializing 'int (^)()' with an expression of type 'int'}}
 }
 
 int blah() {
index f4eff65ed482d51c75b9e30a3595cf784589acba..10b3b8480cc9638e09b14f75a37821afca43b2c8 100644 (file)
@@ -4,7 +4,7 @@ typedef void (^CL)(void);
 
 CL foo() {
   short y;
-  short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'short (^)(void)' from an expression of type 'int (^)(void)'}}
+  short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'short (^)(void)' with an expression of type 'int (^)(void)'}}
 
   CL X = ^{
     if (2)
@@ -26,7 +26,7 @@ CL foo() {
       return (char*)0;
   };
 
-  double (^A)(void) = ^ { // expected-error {{incompatible block pointer types initializing 'double (^)(void)' from an expression of type 'float (^)(void)'}}
+  double (^A)(void) = ^ { // expected-error {{incompatible block pointer types initializing 'double (^)(void)' with an expression of type 'float (^)(void)'}}
     if (1)
       return (float)1.0;
     else
@@ -78,8 +78,8 @@ static int funk(char *s) {
 }
 void next();
 void foo4() {
-  int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char const *)' from an expression of type 'int (^)(char *)'}}
-  int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(char const *)' from an expression of type 'int (char *)'}}
+  int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char const *)' with an expression of type 'int (^)(char *)'}}
+  int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(char const *)' with an expression of type 'int (char *)'}}
   
   int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
   // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
@@ -109,7 +109,7 @@ void foo6() {
 
 void foo7()
 {
- const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' from an expression of type 'int (^)(void)'}}
+ const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' with an expression of type 'int (^)(void)'}}
  const int (^CC) (void)  = ^const int{ const int i = 1; return i; }; // OK
 
   int i;
index a3683de10eaf6210b243281328058ae0dd0aa45c..6f275e8b505fbe9172bdf527e62b03ca9c5639e4 100644 (file)
@@ -10,7 +10,7 @@ void test(int x) {
 
 union u w = (union u)2; // expected-warning {{C99 forbids casts to union type}}
 union u ww = (union u)1.0; // expected-error{{cast to union type from type 'double' not present in union}}
-union u x = 7; // expected-error{{initializing 'union u' from an expression of incompatible type 'int'}}
+union u x = 7; // expected-error{{initializing 'union u' with an expression of incompatible type 'int'}}
 int i;
 union u zz = (union u)i; // expected-error{{initializer element is not a compile-time constant}}  expected-warning {{C99 forbids casts to union type}}
 
index 205fa719b569b0c9f2d2dd04e42e9878a63f0824..08c30b3c876decacb62bd99811996db5b66c8832 100644 (file)
@@ -9,7 +9,7 @@ static int *p = (int []){2,4};
 static int x = (int){1};
 
 static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
-static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' from an expression of type 'char [2]'}}
+static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
 
 typedef struct { } cache_t; // -expected-warning{{use of empty struct extension}}
 static cache_t clo_I1_cache = ((cache_t) { } ); // -expected-warning{{use of GNU empty initializer extension}}
index caab5d37562a3f75a0c7f822d09ea9ccfec68e67..ba4e56b907a72c667dc736c11005d4ff16ed3196 100644 (file)
@@ -91,7 +91,7 @@ static enum e1 badfunc(struct s1 *q) {
 typedef enum {
   an_enumerator = 20
 } an_enum;
-char * s = (an_enum) an_enumerator; // expected-warning {{incompatible integer to pointer conversion initializing 'char *' from an expression of type 'an_enum'}}
+char * s = (an_enum) an_enumerator; // expected-warning {{incompatible integer to pointer conversion initializing 'char *' with an expression of type 'an_enum'}}
 
 // PR4515
 enum PR4515 {PR4515a=1u,PR4515b=(PR4515a-2)/2};
index 1ade42f31c5bfcede6ba93839590129502b3b081..3e4870e0cab112f7cbf47ea8175265fb18075865 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 %s -verify -fsyntax-only
 
 int a;
-struct {int x;} x = a; // expected-error {{from an expression of incompatible type 'int'}}
+struct {int x;} x = a; // expected-error {{with an expression of incompatible type 'int'}}
index ace608e0e603ed1aaab717155a59d4d1b776ea9c..08a4a2bf83e9f3ca34918009f3518d5883c3270a 100644 (file)
@@ -6,7 +6,7 @@ void abcdefghi12(void) {
 }
 
 char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
-                       expected-warning {{initializing 'char *' from an expression of type 'char const [1]' discards qualifiers}}
+                       expected-warning {{initializing 'char *' with an expression of type 'char const [1]' discards qualifiers}}
 
 void a() {
   __func__[0] = 'a';  // expected-error {{variable is not assignable}}
index ce63956c955c874b306d07dcd075d57ff0f2dea8..65bef9f60555fd0198241c1b0ad668b3bc0fd8c7 100644 (file)
@@ -13,5 +13,5 @@ struct x {int a;} *c = b; // expected-warning {{incompatible pointer types}}
 
 struct x {int a;} r;
 int b() {
-struct x {char x;} s = r; // expected-error {{initializing 'struct x' from an expression of incompatible type 'struct x'}}
+struct x {char x;} s = r; // expected-error {{initializing 'struct x' with an expression of incompatible type 'struct x'}}
 }
index c0b7741125003f47bdcd560b1c83764487168c27..04af00ca2d835b87e0841d700a4260b06753d5e7 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -verify -fsyntax-only -Wwrite-strings %s
 
 // PR4804
-char* x = "foo"; // expected-warning {{initializing 'char *' from an expression of type 'char const [4]' discards qualifiers}}
+char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'char const [4]' discards qualifiers}}
index cabf813679cd84ca1cca9df55e0f17f887618635..98cf488792123e579ef665d48c98a25ae71a9a17 100644 (file)
@@ -9,7 +9,7 @@ extern Object* foo(void);
 
 static Derived *test(void)
 {
-   Derived *m = foo();   // expected-warning {{incompatible pointer types initializing 'Derived *' from an expression of type 'Object *'}}
+   Derived *m = foo();   // expected-warning {{incompatible pointer types initializing 'Derived *' with an expression of type 'Object *'}}
 
    return m;
 }
index 9f34ca0e69709091dc7475a5287cddc1baeeb1a3..3b5f609e4213df59cd48b03eae0ac2f31a32c8dc 100644 (file)
@@ -27,11 +27,11 @@ void f1(id x, A *a) {
 }
 
 void f2(id<P1> x) {
-  id<P0> l = x; // expected-warning {{initializing 'id<P0>' from an expression of incompatible type 'id<P1>'}}
+  id<P0> l = x; // expected-warning {{initializing 'id<P0>' with an expression of incompatible type 'id<P1>'}}
 }
 
 void f3(A *a) {
-  id<P1> l = a; // expected-warning {{ initializing 'id<P1>' from an expression of incompatible type 'A *'}}
+  id<P1> l = a; // expected-warning {{ initializing 'id<P1>' with an expression of incompatible type 'A *'}}
 }
 
 void f4(int cond, id x, A *a) {
index 944c1753dd2cc93a3aff98c3a7fd9017b8638d9c..b3317f58061db0ac0bafec2734a45e28c9b5b1d9 100644 (file)
@@ -26,7 +26,7 @@ A *f1_a(int cond, A *a) {
 }
 
 void *f1_const_a(int x, void *p, const A * q) {
-  void *r = x ? p : q; // expected-warning{{initializing 'void *' from an expression of type 'void const *' discards qualifiers}}
+  void *r = x ? p : q; // expected-warning{{initializing 'void *' with an expression of type 'void const *' discards qualifiers}}
   return r;
 }
 
index fc4bfcc95c0891b17df0a16fdeab7f60a8e73ca0..fed3961ce111d808a4a84467600d95fc75117252 100644 (file)
@@ -87,7 +87,7 @@ struct S { int X; } S;
 int test5(int X) {
   int a = [X somemsg];  // expected-warning {{receiver type 'int' is not 'id'}} \
                            expected-warning {{method '-somemsg' not found}} \
-                           expected-warning {{incompatible pointer to integer conversion initializing 'int' from an expression of type 'id'}}
+                           expected-warning {{incompatible pointer to integer conversion initializing 'int' with an expression of type 'id'}}
   int b = [S somemsg];  // expected-error {{bad receiver type 'struct S'}}
 }
 
index c0b7741125003f47bdcd560b1c83764487168c27..04af00ca2d835b87e0841d700a4260b06753d5e7 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -verify -fsyntax-only -Wwrite-strings %s
 
 // PR4804
-char* x = "foo"; // expected-warning {{initializing 'char *' from an expression of type 'char const [4]' discards qualifiers}}
+char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'char const [4]' discards qualifiers}}