+2009-07-01 Jason Merrill <jason@redhat.com>
+
+ * pt.c (register_specialization): Use duplicate_decls to merge
+ the argument with a previous specialization.
+ (check_explicit_specialization): Call register_specialization to
+ merge the TEMPLATE_DECL with a previous version.
+ (determine_specialization): Return the args even if fn is a template.
+
2009-07-01 Ian Lance Taylor <iant@google.com>
* g++spec.c (lang_specific_driver): Bump num_args by 1.
return fn;
}
}
+ else if (fn)
+ return duplicate_decls (spec, fn, is_friend);
/* A specialization must be declared in the same namespace as the
template it is specializing. */
if (candidates)
{
tree fn = TREE_VALUE (candidates);
- /* DECL is a re-declaration of a template function. */
+ *targs_out = copy_node (DECL_TI_ARGS (fn));
+ /* DECL is a re-declaration or partial instantiation of a template
+ function. */
if (TREE_CODE (fn) == TEMPLATE_DECL)
return fn;
/* It was a specialization of an ordinary member function in a
template class. */
- *targs_out = copy_node (DECL_TI_ARGS (fn));
return DECL_TI_TEMPLATE (fn);
}
parm = TREE_CHAIN (parm))
DECL_CONTEXT (parm) = result;
}
- return tmpl;
+ return register_specialization (tmpl, gen_tmpl, targs,
+ is_friend);
}
/* Set up the DECL_TEMPLATE_INFO for DECL. */