From: Kriang Lerdsuwanakij Date: Thu, 20 Jun 2002 15:11:09 +0000 (+0000) Subject: re PR c++/6723 (ICE on source code successfully compiled by previous versions) X-Git-Tag: releases/gcc-3.1.1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0f2e259275e3e01dda6379508a6e9d37155f3a;p=thirdparty%2Fgcc.git re PR c++/6723 (ICE on source code successfully compiled by previous versions) PR c++/6723 * pt.c (lookup_template_class): Don't build complete argument of BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template argument. * g++.dg/template/ttp4.C: New test. From-SVN: r54837 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20fbb8f574d6..c3b910d92896 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2002-06-20 Kriang Lerdsuwanakij + + PR c++/6723 + * pt.c (lookup_template_class): Don't build complete argument of + BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template + argument. + 2002-06-16 Richard Henderson PR opt/6793 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 6571c70638a0..922f02cb6229 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3942,10 +3942,16 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain) The template parameter level of T and U are one level larger than of TT. To proper process the default argument of U, say when an instantiation `TT' is seen, we need to build the full - arguments containing {int} as the innermost level. Outer levels - can be obtained from `current_template_args ()'. */ + arguments containing {int} as the innermost level. Outer levels, + available when not appearing as default template argument, can be + obtained from `current_template_args ()'. - if (processing_template_decl) + Suppose that TT is later substituted with std::vector. The above + instantiation is `TT >' with TT at + level 1, and T at level 2, while the template arguments at level 1 + becomes {std::vector} and the inner level 2 is {int}. */ + + if (current_template_parms) arglist = add_to_template_args (current_template_args (), arglist); arglist2 = coerce_template_parms (parmlist, arglist, template, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9eaaa61543e6..8a29698331d4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-06-20 Kriang Lerdsuwanakij + + * g++.dg/template/ttp4.C: New test. + 2002-06-19 Jakub Jelinek * g++.dg/opt/vt1.C: Fix regexp.