diff options
author | Jason Merrill <jason@redhat.com> | 2014-02-25 16:27:44 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-02-25 16:27:44 -0500 |
commit | 241172a5cdd40dfde479d0fea166d44405ba0447 (patch) | |
tree | 8f0fc7e4dfb21bc44072f0433e7ec21805a4cb69 | |
parent | 944b63dbc00d4866e40f5ee0b743b2c2f71c0fac (diff) | |
download | gcc-241172a5cdd40dfde479d0fea166d44405ba0447.zip gcc-241172a5cdd40dfde479d0fea166d44405ba0447.tar.gz gcc-241172a5cdd40dfde479d0fea166d44405ba0447.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/call.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c4a8177..b353499 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-02-25 Jason Merrill <jason@redhat.com> + * 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 d3db585..700099d 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 " "%<this%> 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) |