From: Jason Merrill Date: Tue, 25 Feb 2014 21:27:44 +0000 (-0500) Subject: call.c (print_conversion_rejection): Handle n_arg of -2. X-Git-Tag: releases/gcc-4.9.0~665 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=241172a5cdd40dfde479d0fea166d44405ba0447;p=thirdparty%2Fgcc.git call.c (print_conversion_rejection): Handle n_arg of -2. * call.c (print_conversion_rejection): Handle n_arg of -2. (build_user_type_conversion_1): Pass it. From-SVN: r208158 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c4a81771a5b7..b3534991d41d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-02-25 Jason Merrill + * call.c (print_conversion_rejection): Handle n_arg of -2. + (build_user_type_conversion_1): Pass it. + PR c++/55877 * decl2.c (no_linkage_error): Handle C++98 semantics. (reset_type_linkage): Move from decl.c. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index d3db585ecbe0..700099d99ddf 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3180,6 +3180,10 @@ print_conversion_rejection (location_t loc, struct conversion_info *info) inform (loc, " no known conversion for implicit " "% parameter from %qT to %qT", info->from_type, info->to_type); + else if (info->n_arg == -2) + /* Conversion of conversion function return value failed. */ + inform (loc, " no known conversion from %qT to %qT", + info->from_type, info->to_type); else inform (loc, " no known conversion for argument %d from %qT to %qT", info->n_arg+1, info->from_type, info->to_type); @@ -3604,7 +3608,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, if (!ics) { cand->viable = 0; - cand->reason = arg_conversion_rejection (NULL_TREE, -1, + cand->reason = arg_conversion_rejection (NULL_TREE, -2, rettype, totype); } else if (DECL_NONCONVERTING_P (cand->fn) @@ -3624,7 +3628,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, { cand->viable = -1; cand->reason - = bad_arg_conversion_rejection (NULL_TREE, -1, + = bad_arg_conversion_rejection (NULL_TREE, -2, rettype, totype); } else if (primary_template_instantiation_p (cand->fn)