Commit 603a0084 by Paolo Carlini Committed by Paolo Carlini

call.c (convert_like_real): Call print_z_candidate and inform only if permerror returns true.

2014-07-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* call.c (convert_like_real): Call print_z_candidate and inform only
	if permerror returns true.

From-SVN: r212560
parent 78d22941
2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (convert_like_real): Call print_z_candidate and inform only
if permerror returns true.
2014-07-14 Jan Hubicka <hubicka@ucw.cz> 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
* class.c (build_clone): Do not clear assembler names of * class.c (build_clone): Do not clear assembler names of
......
...@@ -6076,9 +6076,11 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -6076,9 +6076,11 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
{ {
if (t->kind == ck_user && t->cand->reason) if (t->kind == ck_user && t->cand->reason)
{ {
permerror (loc, "invalid user-defined conversion " complained = permerror (loc, "invalid user-defined conversion "
"from %qT to %qT", TREE_TYPE (expr), totype); "from %qT to %qT", TREE_TYPE (expr),
print_z_candidate (loc, "candidate is:", t->cand); totype);
if (complained)
print_z_candidate (loc, "candidate is:", t->cand);
expr = convert_like_real (t, expr, fn, argnum, 1, expr = convert_like_real (t, expr, fn, argnum, 1,
/*issue_conversion_warnings=*/false, /*issue_conversion_warnings=*/false,
/*c_cast_p=*/false, /*c_cast_p=*/false,
...@@ -6089,7 +6091,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -6089,7 +6091,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
complain); complain);
else else
expr = cp_convert (totype, expr, complain); expr = cp_convert (totype, expr, complain);
if (fn) if (complained && fn)
inform (DECL_SOURCE_LOCATION (fn), inform (DECL_SOURCE_LOCATION (fn),
" initializing argument %P of %qD", argnum, fn); " initializing argument %P of %qD", argnum, fn);
return expr; return expr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment