2017-05-10 Jason Merrill <jason@redhat.com>
+ * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
+ (unify_type_mismatch, unify_parameter_pack_mismatch)
+ (unify_ptrmem_cst_mismatch, unify_expression_unequal)
+ (unify_parameter_pack_inconsistent, unify_inconsistency)
+ (unify_vla_arg, unify_method_type_error, unify_arity)
+ (unify_arg_conversion, unify_no_common_base)
+ (unify_inconsistent_template_template_parameters)
+ (unify_template_deduction_failure)
+ (unify_template_argument_mismatch)
+ (unify_overload_resolution_failure): Call unify_invalid.
+
CWG 1847 - Clarifying compatibility during partial ordering
* pt.c (more_specialized_fn): No order between two non-deducible
parameters.
return 0;
}
+/* Other failure functions should call this one, to provide a single function
+ for setting a breakpoint on. */
+
static int
-unify_parameter_deduction_failure (bool explain_p, tree parm)
+unify_invalid (bool /*explain_p*/)
{
- if (explain_p)
- inform (input_location,
- " couldn't deduce template parameter %qD", parm);
return 1;
}
static int
-unify_invalid (bool /*explain_p*/)
+unify_parameter_deduction_failure (bool explain_p, tree parm)
{
- return 1;
+ if (explain_p)
+ inform (input_location,
+ " couldn't deduce template parameter %qD", parm);
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" types %qT and %qT have incompatible cv-qualifiers",
parm, arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
{
if (explain_p)
inform (input_location, " mismatched types %qT and %qT", parm, arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
" template parameter %qD is not a parameter pack, but "
"argument %qD is",
parm, arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
" template argument %qE does not match "
"pointer-to-member constant %qE",
arg, parm);
- return 1;
+ return unify_invalid (explain_p);
}
static int
{
if (explain_p)
inform (input_location, " %qE is not equivalent to %qE", parm, arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" inconsistent parameter pack deduction with %qT and %qT",
old_arg, new_arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
" deduced conflicting values for non-type parameter "
"%qE (%qE and %qE)", parm, first, second);
}
- return 1;
+ return unify_invalid (explain_p);
}
static int
" variable-sized array type %qT is not "
"a valid template argument",
arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" member function type %qT is not a valid template argument",
arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
" candidate expects %d arguments, %d provided",
wanted, have);
}
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (EXPR_LOC_OR_LOC (arg, input_location),
" cannot convert %qE (type %qT) to type %qT",
arg, from_type, to_type);
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location, " %qT is not derived from %qT", arg, parm);
break;
}
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" template parameters of a template template argument are "
"inconsistent with other deduced template arguments");
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" can't deduce a template for %qT from non-template type %qT",
parm, arg);
- return 1;
+ return unify_invalid (explain_p);
}
static int
if (explain_p)
inform (input_location,
" template argument %qE does not match %qE", arg, parm);
- return 1;
+ return unify_invalid (explain_p);
}
static int
inform (input_location,
" could not resolve address from overloaded function %qE",
arg);
- return 1;
+ return unify_invalid (explain_p);
}
/* Attempt to convert the non-type template parameter EXPR to the