]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/6723 (ICE on source code successfully compiled by previous versions)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Thu, 20 Jun 2002 15:11:09 +0000 (15:11 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Thu, 20 Jun 2002 15:11:09 +0000 (15:11 +0000)
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

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

index 20fbb8f574d642a840a13b4f9994335ef5443773..c3b910d928966e7d373e4cc8784b62fc48ffe892 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       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  <rth@redhat.com>
 
        PR opt/6793
index 6571c70638a0f41c63ef767b16458f942eeb0fac..922f02cb6229f7b1a494b988c7d9ae6fda789b17 100644 (file)
@@ -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<int>' 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<int, std::allocator<T> >' 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,
index 9eaaa61543e62a40754fc4929bb0b8d1bd6441ed..8a29698331d424ea2666575c1ffa23fa9de11576 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       * g++.dg/template/ttp4.C: New test.
+
 2002-06-19  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/opt/vt1.C: Fix regexp.