diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-07-15 13:41:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-07-15 13:41:58 +0000 |
commit | 603a0084b1bb600833e17822b18353f841b16467 (patch) | |
tree | c3a59735f52b09c3afcd7fbcf0209fba87200de5 /gcc | |
parent | 78d22941b3e3c7a74bc87f6f50ae908338c11c6a (diff) | |
download | gcc-603a0084b1bb600833e17822b18353f841b16467.zip gcc-603a0084b1bb600833e17822b18353f841b16467.tar.gz gcc-603a0084b1bb600833e17822b18353f841b16467.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ffee53..697ba79 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> * class.c (build_clone): Do not clear assembler names of diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b16c6e4..6da1218 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6076,9 +6076,11 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, { if (t->kind == ck_user && t->cand->reason) { - permerror (loc, "invalid user-defined conversion " - "from %qT to %qT", TREE_TYPE (expr), totype); - print_z_candidate (loc, "candidate is:", t->cand); + complained = permerror (loc, "invalid user-defined conversion " + "from %qT to %qT", TREE_TYPE (expr), + totype); + if (complained) + print_z_candidate (loc, "candidate is:", t->cand); expr = convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, /*c_cast_p=*/false, @@ -6089,7 +6091,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, complain); else expr = cp_convert (totype, expr, complain); - if (fn) + if (complained && fn) inform (DECL_SOURCE_LOCATION (fn), " initializing argument %P of %qD", argnum, fn); return expr; |