* semantics.c (begin_class_definition): Call
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Nov 1998 02:35:15 +0000 (02:35 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Nov 1998 02:35:15 +0000 (02:35 +0000)
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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/pt.c
gcc/cp/search.c
gcc/cp/semantics.c

index 5f56a03..367be02 100644 (file)
@@ -1,3 +1,15 @@
+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.
index 8980c11..a373f1f 100644 (file)
@@ -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);
index c2b4a1d..c8ad1fe 100644 (file)
@@ -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);
index 9955835..27e63d7 100644 (file)
@@ -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))
index f9ec9dc..8d507dc 100644 (file)
@@ -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)
index 5e3876f..b1278dc 100644 (file)
@@ -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