+/* The next set of functions are used for providing helpful explanatory
+ diagnostics for failed overload resolution. Their messages should be
+ indented by two spaces for consistency with the messages in
+ call.c */
+
+static int
+unify_success (bool explain_p ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+static int
+unify_parameter_deduction_failure (bool explain_p, tree parm)
+{
+ if (explain_p)
+ inform (input_location,
+ " couldn't deduce template parameter %qD", parm);
+ return 1;
+}
+
+static int
+unify_invalid (bool explain_p ATTRIBUTE_UNUSED)
+{
+ return 1;
+}
+
+static int
+unify_cv_qual_mismatch (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " types %qT and %qT have incompatible cv-qualifiers",
+ parm, arg);
+ return 1;
+}
+
+static int
+unify_type_mismatch (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location, " mismatched types %qT and %qT", parm, arg);
+ return 1;
+}
+
+static int
+unify_parameter_pack_mismatch (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " template parameter %qD is not a parameter pack, but "
+ "argument %qD is",
+ parm, arg);
+ return 1;
+}
+
+static int
+unify_ptrmem_cst_mismatch (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " template argument %qE does not match "
+ "pointer-to-member constant %qE",
+ arg, parm);
+ return 1;
+}
+
+static int
+unify_expression_unequal (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location, " %qE is not equivalent to %qE", parm, arg);
+ return 1;
+}
+
+static int
+unify_parameter_pack_inconsistent (bool explain_p, tree old_arg, tree new_arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " inconsistent parameter pack deduction with %qT and %qT",
+ old_arg, new_arg);
+ return 1;
+}
+
+static int
+unify_inconsistency (bool explain_p, tree parm, tree first, tree second)
+{
+ if (explain_p)
+ inform (input_location,
+ " conflicting deductions for parameter %qE (%qE and %qE)",
+ parm, first, second);
+ return 1;
+}
+
+static int
+unify_vla_arg (bool explain_p, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " variable-sized array type %qT is not "
+ "a valid template argument",
+ arg);
+ return 1;
+}
+
+static int
+unify_method_type_error (bool explain_p, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " member function type %qT is not a valid template argument",
+ arg);
+ return 1;
+}
+
+static int
+unify_arity (bool explain_p, int have, int wanted)
+{
+ if (explain_p)
+ inform_n (input_location, wanted,
+ " candidate expects %d argument, %d provided",
+ " candidate expects %d arguments, %d provided",
+ wanted, have);
+ return 1;
+}
+
+static int
+unify_too_many_arguments (bool explain_p, int have, int wanted)
+{
+ return unify_arity (explain_p, have, wanted);
+}
+
+static int
+unify_too_few_arguments (bool explain_p, int have, int wanted)
+{
+ return unify_arity (explain_p, have, wanted);
+}
+
+static int
+unify_arg_conversion (bool explain_p, tree to_type,
+ tree from_type, tree arg)
+{
+ if (explain_p)
+ inform (input_location, " cannot convert %qE (type %qT) to type %qT",
+ arg, from_type, to_type);
+ return 1;
+}
+
+static int
+unify_no_common_base (bool explain_p, enum template_base_result r,
+ tree parm, tree arg)
+{
+ if (explain_p)
+ switch (r)
+ {
+ case tbr_ambiguous_baseclass:
+ inform (input_location, " %qT is an ambiguous base class of %qT",
+ arg, parm);
+ break;
+ default:
+ inform (input_location, " %qT is not derived from %qT", arg, parm);
+ break;
+ }
+ return 1;
+}
+
+static int
+unify_inconsistent_template_template_parameters (bool explain_p)
+{
+ if (explain_p)
+ inform (input_location,
+ " template parameters of a template template argument are "
+ "inconsistent with other deduced template arguments");
+ return 1;
+}
+
+static int
+unify_template_deduction_failure (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " can't deduce a template for %qT from non-template type %qT",
+ parm, arg);
+ return 1;
+}
+
+static int
+unify_template_argument_mismatch (bool explain_p, tree parm, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " template argument %qE does not match %qD", arg, parm);
+ return 1;
+}
+
+static int
+unify_overload_resolution_failure (bool explain_p, tree arg)
+{
+ if (explain_p)
+ inform (input_location,
+ " could not resolve address from overloaded function %qE",
+ arg);
+ return 1;
+}
+