]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13635 (ICE in register_specialization for specific order of template specia...
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Mon, 23 Feb 2004 14:43:12 +0000 (14:43 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Mon, 23 Feb 2004 14:43:12 +0000 (14:43 +0000)
PR c++/13635
* pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
has full set of arguments.

* g++.dg/template/spec11.C: New test.

From-SVN: r78307

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

index 90c15299c05d4fa999245926ca1b8c14b960028c..a38749fdee6a713a5b640a047e91823819ea6460 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-23  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/13635
+       * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
+       has full set of arguments.
+
 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14250
index 0caecaf4cae69896cad975f70d80d63b6e961fbd..154cdcbedd8254d5608f6f0c95c5313dcae2a98d 100644 (file)
@@ -960,7 +960,7 @@ register_specialization (spec, tmpl, args)
        the default argument expression is not substituted for in an
        instantiation unless and until it is actually needed.  */
     return spec;
-    
+
   /* There should be as many levels of arguments as there are
      levels of parameters.  */
   my_friendly_assert (TMPL_ARGS_DEPTH (args) 
@@ -2918,6 +2918,13 @@ push_template_decl_real (decl, is_friend)
        }
     }
 
+  /* The DECL_TI_ARGS of DECL contains full set of arguments refering
+     back to its most general template.  If TMPL is a specialization,
+     ARGS may only have the innermost set of arguments.  Add the missing
+     argument levels if necessary.  */
+  if (DECL_TEMPLATE_INFO (tmpl))
+    args = add_outermost_template_args (DECL_TI_ARGS (tmpl), args);
+
   info = tree_cons (tmpl, args, NULL_TREE);
 
   if (DECL_IMPLICIT_TYPEDEF_P (decl))
index 028da9a67f9e5ff443b9cadd9af1bab5a09b47f4..6773baaf1286ff27dbad1673b3666722ab312857 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-23  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/13635
+       * g++.dg/template/spec11.C: New test.
+
 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14250