Commit 241172a5 by Jason Merrill Committed by Jason Merrill

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
parent 944b63db
2014-02-25 Jason Merrill <jason@redhat.com> 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 PR c++/55877
* decl2.c (no_linkage_error): Handle C++98 semantics. * decl2.c (no_linkage_error): Handle C++98 semantics.
(reset_type_linkage): Move from decl.c. (reset_type_linkage): Move from decl.c.
......
...@@ -3180,6 +3180,10 @@ print_conversion_rejection (location_t loc, struct conversion_info *info) ...@@ -3180,6 +3180,10 @@ print_conversion_rejection (location_t loc, struct conversion_info *info)
inform (loc, " no known conversion for implicit " inform (loc, " no known conversion for implicit "
"%<this%> parameter from %qT to %qT", "%<this%> parameter from %qT to %qT",
info->from_type, info->to_type); 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 else
inform (loc, " no known conversion for argument %d from %qT to %qT", inform (loc, " no known conversion for argument %d from %qT to %qT",
info->n_arg+1, info->from_type, info->to_type); 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, ...@@ -3604,7 +3608,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags,
if (!ics) if (!ics)
{ {
cand->viable = 0; cand->viable = 0;
cand->reason = arg_conversion_rejection (NULL_TREE, -1, cand->reason = arg_conversion_rejection (NULL_TREE, -2,
rettype, totype); rettype, totype);
} }
else if (DECL_NONCONVERTING_P (cand->fn) else if (DECL_NONCONVERTING_P (cand->fn)
...@@ -3624,7 +3628,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, ...@@ -3624,7 +3628,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags,
{ {
cand->viable = -1; cand->viable = -1;
cand->reason cand->reason
= bad_arg_conversion_rejection (NULL_TREE, -1, = bad_arg_conversion_rejection (NULL_TREE, -2,
rettype, totype); rettype, totype);
} }
else if (primary_template_instantiation_p (cand->fn) else if (primary_template_instantiation_p (cand->fn)
......
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