OSDN Git Service

PR c++/44148
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 May 2010 20:23:59 +0000 (20:23 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:09:34 +0000 (14:09 +0900)
* pt.c (tsubst): Unshare template argument.

* g++.dg/torture/pr44148.C: New test.

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

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

index 1f56ae0..fda48be 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/44148
+       * pt.c (tsubst): Unshare template argument.
+
 2010-05-15  Steven Bosscher  <steven@gcc.gnu.org>
 
        * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
index 1ff1fe2..7a66d36 100644 (file)
@@ -10150,7 +10150,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
              }
            else
              /* TEMPLATE_TEMPLATE_PARM or TEMPLATE_PARM_INDEX.  */
-             return arg;
+             return unshare_expr (arg);
          }
 
        if (level == 1)
index 2ee5942..b41cfac 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/44148
+       * g++.dg/torture/pr44148.C: New test.
+
 2010-05-15  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/c1x-anon-struct-1.c, gcc.dg/c1x-anon-struct-2.c,