From: Kriang Lerdsuwanakij Date: Mon, 23 Feb 2004 14:43:12 +0000 (+0000) Subject: re PR c++/13635 (ICE in register_specialization for specific order of template specia... X-Git-Tag: releases/gcc-3.3.4~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6022f8dfe2079e91e428a290d4b3a186d334f81;p=thirdparty%2Fgcc.git re PR c++/13635 (ICE in register_specialization for specific order of template specialization) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 90c15299c05d..a38749fdee6a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-02-23 Kriang Lerdsuwanakij + + 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 PR c++/14250 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0caecaf4cae6..154cdcbedd82 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 028da9a67f9e..6773baaf1286 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-23 Kriang Lerdsuwanakij + + PR c++/13635 + * g++.dg/template/spec11.C: New test. + 2004-02-23 Giovanni Bajo PR c++/14250