]> gcc.gnu.org Git - gcc.git/commitdiff
* pt.c (push_template_decl): Only check primary templates.
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 18 Mar 1998 02:30:09 +0000 (02:30 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 18 Mar 1998 02:30:09 +0000 (21:30 -0500)
From-SVN: r18653

gcc/cp/ChangeLog
gcc/cp/pt.c

index 31dcfe42b54efbac006c32962bd89a3eaeae1cf5..216ced7007bd7ceccafdfbade79f01746ea3b2cf 100644 (file)
@@ -1,5 +1,7 @@
 Wed Mar 18 00:24:10 1998  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * pt.c (push_template_decl): Only check primary templates.
+
        * pt.c (check_explicit_specialization): Complain about default args
        in explicit specialization.
 
index 30b4054d6554832a0236ffd8f0f23a711bec9e41..13fd811c785a2a9c333bd090396fbd35c5583fa4 100644 (file)
@@ -1381,11 +1381,6 @@ push_template_decl (decl)
   int is_friend = (TREE_CODE (decl) == FUNCTION_DECL
                   && DECL_FRIEND_P (decl));
 
-  if (current_lang_name == lang_name_c)
-    cp_error ("template with C linkage");
-  if (TREE_CODE (decl) == TYPE_DECL && ANON_AGGRNAME_P (DECL_NAME (decl)))
-    cp_error ("template class without a name");
-
   if (is_friend)
     /* For a friend, we want the context of the friend function, not
        the type of which it is a friend.  */
@@ -1416,6 +1411,14 @@ push_template_decl (decl)
   else
     primary = 0;
 
+  if (primary)
+    {
+      if (current_lang_name == lang_name_c)
+       cp_error ("template with C linkage");
+      if (TREE_CODE (decl) == TYPE_DECL && ANON_AGGRNAME_P (DECL_NAME (decl)))
+       cp_error ("template class without a name");
+    }
+
   /* Partial specialization.  */
   if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)
       && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
This page took 0.123155 seconds and 5 git commands to generate.