Commit ff350acd by Jason Merrill Committed by Jason Merrill

semantics.c (begin_class_definition): Call maybe_process_partial_specialization…

semantics.c (begin_class_definition): Call maybe_process_partial_specialization before push_template_decl.

	* 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.

From-SVN: r23705
parent c877974e
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.
......
......@@ -10530,7 +10530,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
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);
......
......@@ -4946,6 +4946,8 @@ handle_class_head (aggr, scope, id)
{
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);
......
......@@ -2687,8 +2687,8 @@ convert_nontype_argument (type, expr)
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))
......
......@@ -1190,6 +1190,11 @@ lookup_field (xbasetype, name, protect, want_type)
&& ! 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)
......
......@@ -1230,11 +1230,12 @@ begin_class_definition (t)
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
......
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