parmnum, complain, flags);
}
else if (fndecl)
- error_at (EXPR_LOC_OR_LOC (rhs, input_location),
- "cannot convert %qH to %qI for argument %qP to %qD",
- rhstype, type, parmnum, fndecl);
+ {
+ error_at (EXPR_LOC_OR_LOC (rhs, input_location),
+ "cannot convert %qH to %qI",
+ rhstype, type);
+ inform (get_fndecl_argument_location (fndecl, parmnum),
+ " initializing argument %P of %qD", parmnum, fndecl);
+ }
else
switch (errtype)
{
D *d7 = new D { 9 }; // { dg-error "cannot convert \[^\n\r]* to 'D' in initialization" "" { target c++14_down } }
E *e5 = new E { -4 }; // { dg-error "cannot convert \[^\n\r]* to 'E' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of '-4' from 'int' to 'unsigned char' inside" "" { target c++17 } .-1 }
- bar ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E' for argument" }
+ bar ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E'" }
bar (E { 9 }); // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
V v1 = { { 11 } }; // { dg-error "braces around scalar initializer for type 'E'" }
V v2 = { E { 12 } }; // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
D *d7 = new D { 9 }; // { dg-error "cannot convert \[^\n\r]* to 'D' in initialization" "" { target c++14_down } }
E *e5 = new E { -4 }; // { dg-error "cannot convert \[^\n\r]* to 'E' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of '-4' from 'int' to 'unsigned char' inside" "" { target c++17 } .-1 }
- bar ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E' for argument" }
+ bar ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E'" }
bar (E { 9 }); // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
V v1 = { { 11 } }; // { dg-error "braces around scalar initializer for type 'E'" }
V v2 = { E { 12 } }; // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
K *d7 = new K { 9 }; // { dg-error "cannot convert \[^\n\r]* to 'D' in initialization" "" { target c++14_down } }
L *e5 = new L { -4 }; // { dg-error "cannot convert \[^\n\r]* to 'E' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of '-4' from 'int' to 'unsigned char' inside" "" { target c++17 } .-1 }
- bar3 ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E' for argument" }
+ bar3 ({ 10 }); // { dg-error "cannot convert \[^\n\r]* to 'E'" }
bar3 (E { 9 }); // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
M v1 = { { 11 } }; // { dg-error "braces around scalar initializer for type 'E'" }
M v2 = { L { 12 } }; // { dg-error "cannot convert 'int' to 'E' in initialization" "" { target c++14_down } }
/* decl, with argname. */
-extern int callee_1 (int one, const char **two, float three);
+extern int callee_1 (int one, const char **two, float three); // { dg-line callee_1 }
int test_1 (int first, const char *second, float third)
{
- return callee_1 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*' for argument '2' to 'int callee_1\\(int, const char\\*\\*, float\\)'" }
+ return callee_1 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*'" }
/* { dg-begin-multiline-output "" }
return callee_1 (first, second, third);
^~~~~~
{ dg-end-multiline-output "" } */
+ // { dg-message "initializing argument 2 of 'int callee_1\\(int, const char\\*\\*, float\\)'" "" { target *-*-* } callee_1 }
+ /* { dg-begin-multiline-output "" }
+ extern int callee_1 (int one, const char **two, float three);
+ ~~~~~~~~~~~~~^~~
+ { dg-end-multiline-output "" } */
}
/* decl, without argname. */
-extern int callee_2 (int, const char **, float);
+extern int callee_2 (int, const char **, float); // { dg-line callee_2 }
int test_2 (int first, const char *second, float third)
{
- return callee_2 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*' for argument '2' to 'int callee_2\\(int, const char\\*\\*, float\\)'" }
+ return callee_2 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*'" }
/* { dg-begin-multiline-output "" }
return callee_2 (first, second, third);
^~~~~~
{ dg-end-multiline-output "" } */
+ // { dg-message "initializing argument 2 of 'int callee_2\\(int, const char\\*\\*, float\\)'" "" { target *-*-* } callee_2 }
+ /* { dg-begin-multiline-output "" }
+ extern int callee_2 (int, const char **, float);
+ ^~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
}
/* defn, with argname. */
-static int callee_3 (int one, const char **two, float three)
+static int callee_3 (int one, const char **two, float three) // { dg-line callee_3 }
{
return callee_2 (one, two, three);
}
int test_3 (int first, const char *second, float third)
{
- return callee_3 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*' for argument '2' to 'int callee_3\\(int, const char\\*\\*, float\\)'" }
+ return callee_3 (first, second, third); // { dg-error "27: cannot convert 'const char\\*' to 'const char\\*\\*'" }
/* { dg-begin-multiline-output "" }
return callee_3 (first, second, third);
^~~~~~
{ dg-end-multiline-output "" } */
+ // { dg-message "initializing argument 2 of 'int callee_3\\(int, const char\\*\\*, float\\)'" "" { target *-*-* } callee_3 }
+ /* { dg-begin-multiline-output "" }
+ static int callee_3 (int one, const char **two, float three)
+ ~~~~~~~~~~~~~^~~
+ { dg-end-multiline-output "" } */
}
/* static member, with argname. */