Commit dd54ca56 by Jason Merrill Committed by Jason Merrill

Have other unify failure functions call unify_invalid.

	* 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.

From-SVN: r247857
parent 00e08b0f
2017-05-10 Jason Merrill <jason@redhat.com> 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 CWG 1847 - Clarifying compatibility during partial ordering
* pt.c (more_specialized_fn): No order between two non-deducible * pt.c (more_specialized_fn): No order between two non-deducible
parameters. parameters.
......
...@@ -6105,19 +6105,22 @@ unify_success (bool /*explain_p*/) ...@@ -6105,19 +6105,22 @@ unify_success (bool /*explain_p*/)
return 0; return 0;
} }
/* Other failure functions should call this one, to provide a single function
for setting a breakpoint on. */
static int 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; return 1;
} }
static int 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 static int
...@@ -6127,7 +6130,7 @@ unify_cv_qual_mismatch (bool explain_p, tree parm, tree arg) ...@@ -6127,7 +6130,7 @@ unify_cv_qual_mismatch (bool explain_p, tree parm, tree arg)
inform (input_location, inform (input_location,
" types %qT and %qT have incompatible cv-qualifiers", " types %qT and %qT have incompatible cv-qualifiers",
parm, arg); parm, arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6135,7 +6138,7 @@ unify_type_mismatch (bool explain_p, tree parm, tree arg) ...@@ -6135,7 +6138,7 @@ unify_type_mismatch (bool explain_p, tree parm, tree arg)
{ {
if (explain_p) if (explain_p)
inform (input_location, " mismatched types %qT and %qT", parm, arg); inform (input_location, " mismatched types %qT and %qT", parm, arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6146,7 +6149,7 @@ unify_parameter_pack_mismatch (bool explain_p, tree parm, tree arg) ...@@ -6146,7 +6149,7 @@ unify_parameter_pack_mismatch (bool explain_p, tree parm, tree arg)
" template parameter %qD is not a parameter pack, but " " template parameter %qD is not a parameter pack, but "
"argument %qD is", "argument %qD is",
parm, arg); parm, arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6157,7 +6160,7 @@ unify_ptrmem_cst_mismatch (bool explain_p, tree parm, tree arg) ...@@ -6157,7 +6160,7 @@ unify_ptrmem_cst_mismatch (bool explain_p, tree parm, tree arg)
" template argument %qE does not match " " template argument %qE does not match "
"pointer-to-member constant %qE", "pointer-to-member constant %qE",
arg, parm); arg, parm);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6165,7 +6168,7 @@ unify_expression_unequal (bool explain_p, tree parm, tree arg) ...@@ -6165,7 +6168,7 @@ unify_expression_unequal (bool explain_p, tree parm, tree arg)
{ {
if (explain_p) if (explain_p)
inform (input_location, " %qE is not equivalent to %qE", parm, arg); inform (input_location, " %qE is not equivalent to %qE", parm, arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6175,7 +6178,7 @@ unify_parameter_pack_inconsistent (bool explain_p, tree old_arg, tree new_arg) ...@@ -6175,7 +6178,7 @@ unify_parameter_pack_inconsistent (bool explain_p, tree old_arg, tree new_arg)
inform (input_location, inform (input_location,
" inconsistent parameter pack deduction with %qT and %qT", " inconsistent parameter pack deduction with %qT and %qT",
old_arg, new_arg); old_arg, new_arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6192,7 +6195,7 @@ unify_inconsistency (bool explain_p, tree parm, tree first, tree second) ...@@ -6192,7 +6195,7 @@ unify_inconsistency (bool explain_p, tree parm, tree first, tree second)
" deduced conflicting values for non-type parameter " " deduced conflicting values for non-type parameter "
"%qE (%qE and %qE)", parm, first, second); "%qE (%qE and %qE)", parm, first, second);
} }
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6203,7 +6206,7 @@ unify_vla_arg (bool explain_p, tree arg) ...@@ -6203,7 +6206,7 @@ unify_vla_arg (bool explain_p, tree arg)
" variable-sized array type %qT is not " " variable-sized array type %qT is not "
"a valid template argument", "a valid template argument",
arg); arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6213,7 +6216,7 @@ unify_method_type_error (bool explain_p, tree arg) ...@@ -6213,7 +6216,7 @@ unify_method_type_error (bool explain_p, tree arg)
inform (input_location, inform (input_location,
" member function type %qT is not a valid template argument", " member function type %qT is not a valid template argument",
arg); arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6232,7 +6235,7 @@ unify_arity (bool explain_p, int have, int wanted, bool least_p = false) ...@@ -6232,7 +6235,7 @@ unify_arity (bool explain_p, int have, int wanted, bool least_p = false)
" candidate expects %d arguments, %d provided", " candidate expects %d arguments, %d provided",
wanted, have); wanted, have);
} }
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6256,7 +6259,7 @@ unify_arg_conversion (bool explain_p, tree to_type, ...@@ -6256,7 +6259,7 @@ unify_arg_conversion (bool explain_p, tree to_type,
inform (EXPR_LOC_OR_LOC (arg, input_location), inform (EXPR_LOC_OR_LOC (arg, input_location),
" cannot convert %qE (type %qT) to type %qT", " cannot convert %qE (type %qT) to type %qT",
arg, from_type, to_type); arg, from_type, to_type);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6274,7 +6277,7 @@ unify_no_common_base (bool explain_p, enum template_base_result r, ...@@ -6274,7 +6277,7 @@ unify_no_common_base (bool explain_p, enum template_base_result r,
inform (input_location, " %qT is not derived from %qT", arg, parm); inform (input_location, " %qT is not derived from %qT", arg, parm);
break; break;
} }
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6284,7 +6287,7 @@ unify_inconsistent_template_template_parameters (bool explain_p) ...@@ -6284,7 +6287,7 @@ unify_inconsistent_template_template_parameters (bool explain_p)
inform (input_location, inform (input_location,
" template parameters of a template template argument are " " template parameters of a template template argument are "
"inconsistent with other deduced template arguments"); "inconsistent with other deduced template arguments");
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6294,7 +6297,7 @@ unify_template_deduction_failure (bool explain_p, tree parm, tree arg) ...@@ -6294,7 +6297,7 @@ unify_template_deduction_failure (bool explain_p, tree parm, tree arg)
inform (input_location, inform (input_location,
" can't deduce a template for %qT from non-template type %qT", " can't deduce a template for %qT from non-template type %qT",
parm, arg); parm, arg);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6303,7 +6306,7 @@ unify_template_argument_mismatch (bool explain_p, tree parm, tree arg) ...@@ -6303,7 +6306,7 @@ unify_template_argument_mismatch (bool explain_p, tree parm, tree arg)
if (explain_p) if (explain_p)
inform (input_location, inform (input_location,
" template argument %qE does not match %qE", arg, parm); " template argument %qE does not match %qE", arg, parm);
return 1; return unify_invalid (explain_p);
} }
static int static int
...@@ -6313,7 +6316,7 @@ unify_overload_resolution_failure (bool explain_p, tree arg) ...@@ -6313,7 +6316,7 @@ unify_overload_resolution_failure (bool explain_p, tree arg)
inform (input_location, inform (input_location,
" could not resolve address from overloaded function %qE", " could not resolve address from overloaded function %qE",
arg); arg);
return 1; return unify_invalid (explain_p);
} }
/* Attempt to convert the non-type template parameter EXPR to the /* Attempt to convert the non-type template parameter EXPR to the
......
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