2014-02-21 Jason Merrill <jason@redhat.com>
+ PR c++/60241
+ * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
+ of the partial instantiation, not the most general template.
+ (maybe_process_partial_specialization): Reassign everything on
+ that list.
+
PR c++/60216
* pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
(check_explicit_specialization): Don't clone.
t; t = TREE_CHAIN (t))
{
tree inst = TREE_VALUE (t);
- if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
+ || !COMPLETE_OR_OPEN_TYPE_P (inst))
{
/* We already have a full specialization of this partial
- instantiation. Reassign it to the new member
- specialization template. */
+ instantiation, or a full specialization has been
+ looked up but not instantiated. Reassign it to the
+ new member specialization template. */
spec_entry elt;
spec_entry *entry;
void **slot;
*entry = elt;
*slot = entry;
}
- else if (COMPLETE_OR_OPEN_TYPE_P (inst))
+ else
/* But if we've had an implicit instantiation, that's a
problem ([temp.expl.spec]/6). */
error ("specialization %qT after instantiation %qT",
}
/* Let's consider the explicit specialization of a member
- of a class template specialization that is implicitely instantiated,
+ of a class template specialization that is implicitly instantiated,
e.g.:
template<class T>
struct S
/* Note this use of the partial instantiation so we can check it
later in maybe_process_partial_specialization. */
- DECL_TEMPLATE_INSTANTIATIONS (templ)
+ DECL_TEMPLATE_INSTANTIATIONS (found)
= tree_cons (arglist, t,
- DECL_TEMPLATE_INSTANTIATIONS (templ));
+ DECL_TEMPLATE_INSTANTIATIONS (found));
if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type
&& !DECL_ALIAS_TEMPLATE_P (gen_tmpl))