Commit 6bc7be5f by Jason Merrill Committed by Jason Merrill

* pt.c (determine_specialization): Give better errors.

From-SVN: r17970
parent e3e7774e
Fri Feb 13 14:30:35 1998 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (determine_specialization): Give better errors.
Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com> Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
* init.c (build_new): Propagate error_mark_node up. * init.c (build_new): Propagate error_mark_node up.
......
...@@ -519,7 +519,15 @@ determine_specialization (template_id, decl, targs_out, ...@@ -519,7 +519,15 @@ determine_specialization (template_id, decl, targs_out,
tmpl = DECL_TI_TEMPLATE (fn); tmpl = DECL_TI_TEMPLATE (fn);
else if (TREE_CODE (fn) != TEMPLATE_DECL else if (TREE_CODE (fn) != TEMPLATE_DECL
|| (need_member_template && !is_member_template (fn))) || (need_member_template && !is_member_template (fn)))
continue; {
if (decls_match (decl, fn))
{
cp_error ("`template <>' applied to non-specialization `%D'",
fn);
return NULL_TREE;
}
continue;
}
else else
tmpl = fn; tmpl = fn;
...@@ -564,8 +572,7 @@ determine_specialization (template_id, decl, targs_out, ...@@ -564,8 +572,7 @@ determine_specialization (template_id, decl, targs_out,
{ {
no_match: no_match:
if (complain) if (complain)
cp_error ("`%D' does not match any template declaration", cp_error ("`%D' does not match any template declaration", decl);
template_id);
return NULL_TREE; return NULL_TREE;
} }
...@@ -574,8 +581,7 @@ determine_specialization (template_id, decl, targs_out, ...@@ -574,8 +581,7 @@ determine_specialization (template_id, decl, targs_out,
ambiguous: ambiguous:
if (complain) if (complain)
{ {
cp_error ("ambiguous template specialization `%D'", cp_error ("ambiguous template specialization `%D'", decl);
template_id);
print_candidates (templates); print_candidates (templates);
} }
return NULL_TREE; return NULL_TREE;
......
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