tmpl = DECL_TI_TEMPLATE (fn);
else if (TREE_CODE (fn) != TEMPLATE_DECL
|| (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
tmpl = fn;
{
no_match:
if (complain)
- cp_error ("`%D' does not match any template declaration",
- template_id);
+ cp_error ("`%D' does not match any template declaration", decl);
return NULL_TREE;
}
ambiguous:
if (complain)
{
- cp_error ("ambiguous template specialization `%D'",
- template_id);
+ cp_error ("ambiguous template specialization `%D'", decl);
print_candidates (templates);
}
return NULL_TREE;