OSDN Git Service

Fix PR c++/42697
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Apr 2010 15:16:12 +0000 (15:16 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:49:34 +0000 (09:49 +0900)
gcc/cp/ChangeLog:
PR c++/42697
*pt.c (tsubst_decl): Get the arguments of a specialization from
the specialization template, not from the most general template.

gcc/testsuite/ChangeLog:
PR c++/42697
* g++.dg/template/crash94.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158068 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6af8a20..3d41244 100644 (file)
@@ -1,5 +1,11 @@
 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
 
+       PR c++/42697
+       *pt.c (tsubst_decl): Get the arguments of a specialization from
+       the specialization template, not from the most general template.
+
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
        PR c++/40239
        * typeck2.c (process_init_constructor_record):
        value-initialize members that are are not explicitely
index 0bd55e1..13bb5aa 100644 (file)
@@ -9020,7 +9020,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
               specialize R.  */
            gen_tmpl = most_general_template (DECL_TI_TEMPLATE (t));
            argvec = tsubst_template_args (DECL_TI_ARGS
-                                          (DECL_TEMPLATE_RESULT (gen_tmpl)),
+                                          (DECL_TEMPLATE_RESULT
+                                                 (DECL_TI_TEMPLATE (t))),
                                           args, complain, in_decl);
 
            /* Check to see if we already have this specialization.  */
index 65c9f02..0032dd8 100644 (file)
@@ -1,5 +1,10 @@
 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
 
+       PR c++/42697
+       * g++.dg/template/crash94.C: New test.
+
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
        PR c++/40239
        * g++.dg/init/aggr5.C: New test.
        * g++.dg/init/aggr5.C: New test.