maybe_process_partial_specialization before push_template_decl.
Don't call push_template_decl for a specialization.
* search.c (lookup_field): Do return a member template class.
* decl2.c (handle_class_head): Handle member template classes.
* decl.c (grokdeclarator): A parm type need not be complete.
* pt.c (convert_nontype_argument): Fix thinko.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23705
138bc75d-0d04-0410-961f-
82ee72b054a4
+1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
+
+ * semantics.c (begin_class_definition): Call
+ maybe_process_partial_specialization before push_template_decl.
+ Don't call push_template_decl for a specialization.
+ * search.c (lookup_field): Do return a member template class.
+ * decl2.c (handle_class_head): Handle member template classes.
+
+ * decl.c (grokdeclarator): A parm type need not be complete.
+
+ * pt.c (convert_nontype_argument): Fix thinko.
+
1998-11-18 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
if (decl_context == PARM)
{
- decl = build_decl (PARM_DECL, declarator, complete_type (type));
+ decl = build_decl (PARM_DECL, declarator, type);
bad_specifiers (decl, "parameter", virtualp, quals != NULL_TREE,
inlinep, friendp, raises != NULL_TREE);
{
if (TREE_CODE (id) == TYPE_DECL)
return id;
+ if (DECL_CLASS_TEMPLATE_P (id))
+ return DECL_TEMPLATE_RESULT (id);
if (scope)
cp_error ("`%T' does not have a nested type named `%D'", scope, id);
identical) type of the template-argument. The
template-parameter is bound directly to the
template-argument, which must be an lvalue. */
- if (!same_type_p (TYPE_MAIN_VARIANT (expr_type),
- TYPE_MAIN_VARIANT (type))
+ if ((TYPE_MAIN_VARIANT (expr_type)
+ != TYPE_MAIN_VARIANT (type_referred_to))
|| !at_least_as_qualified_p (type_referred_to,
expr_type)
|| !real_lvalue_p (expr))
&& ! currently_open_class (BINFO_TYPE (rval_binfo))
&& uses_template_parms (type))
{
+ /* We need to return a member template class so we can define partial
+ specializations. Is there a better way? */
+ if (DECL_CLASS_TEMPLATE_P (rval))
+ return rval;
+
/* Don't return a non-type. Actually, we ought to return something
so lookup_name_real can give a warning. */
if (TREE_CODE (rval) != TYPE_DECL)
t = make_lang_type (TREE_CODE (t));
pushtag (TYPE_IDENTIFIER (t), t, 0);
}
- if (processing_template_decl && TYPE_CONTEXT (t)
- && TREE_CODE (TYPE_CONTEXT (t)) != NAMESPACE_DECL
+ maybe_process_partial_specialization (t);
+ if (processing_template_decl
+ && ! CLASSTYPE_TEMPLATE_SPECIALIZATION (t)
+ && TYPE_CONTEXT (t) && TYPE_P (TYPE_CONTEXT (t))
&& ! current_class_type)
push_template_decl (TYPE_STUB_DECL (t));
- maybe_process_partial_specialization (t);
pushclass (t, 0);
TYPE_BEING_DEFINED (t) = 1;
/* Reset the interface data, at the earliest possible