* pt.c (lookup_template_class): Look through implict typename.
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 12 Apr 1999 10:54:06 +0000 (10:54 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 12 Apr 1999 10:54:06 +0000 (06:54 -0400)
From-SVN: r26370

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

index be8c8653ad9e7fbb8b416b96176523d9359cd145..992aaa9daf7c9e383ad4440d6d7d60a1f4764d05 100644 (file)
@@ -1,3 +1,7 @@
+1999-04-12  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (lookup_template_class): Look through implict typename.
+
 1999-04-11  Mark Mitchell  <mark@codesourcery.com>
 
        * friend.c (add_friend): Deal gracefully with error_mark_node.
index 2988ed6fb6f1b957f61efa6166fa6488d481e582..e8de776998099795ddad5f49c567f3f1e901ead4 100644 (file)
@@ -3581,9 +3581,16 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
     }
   else if (TREE_CODE (d1) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (d1)))
     {
-      if (CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (d1)))
+      tree type = TREE_TYPE (d1);
+
+      /* If we are declaring a constructor, say A<T>::A<T>, we will get
+        an implicit typename for the second A.  Deal with it.  */
+      if (TREE_CODE (type) == TYPENAME_TYPE && TREE_TYPE (type))
+       type = TREE_TYPE (type);
+       
+      if (CLASSTYPE_TEMPLATE_INFO (type))
        {
-         template = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (d1));
+         template = CLASSTYPE_TI_TEMPLATE (type);
          d1 = DECL_NAME (template);
        }
     }