commit f84d42ca81f6c327a0356a4dd426a68925db582b
Author: Jason Merrill <jason@redhat.com>
Date: Tue Feb 11 11:10:04 2014 -0800
* call.c (print_conversion_rejection): Handle n_arg of -2.
(build_user_type_conversion_1): Pass it.
@@ -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)