OSDN Git Service

PR c++/51852
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 17:55:55 +0000 (17:55 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 17:55:55 +0000 (17:55 +0000)
* pt.c (tsubst_pack_expansion): Delete and restore
local_specialization whenever need_local_specialization, not just
when saved_local_specializations is non-NULL.

* g++.dg/other/gc5.C: New test.

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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/gc5.C [new file with mode: 0644]

index 3df6d11..9753bed 100644 (file)
@@ -1,3 +1,10 @@
+2012-01-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/51852
+       * pt.c (tsubst_pack_expansion): Delete and restore
+       local_specialization whenever need_local_specialization, not just
+       when saved_local_specializations is non-NULL.
+
 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51370
index e440be7..ad2b4df 100644 (file)
@@ -9582,7 +9582,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
         }
     }
 
-  if (saved_local_specializations)
+  if (need_local_specializations)
     {
       htab_delete (local_specializations);
       local_specializations = saved_local_specializations;
index d7f276a..31ea283 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/51852
+       * g++.dg/other/gc5.C: New test.
+
 2012-01-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/50444
diff --git a/gcc/testsuite/g++.dg/other/gc5.C b/gcc/testsuite/g++.dg/other/gc5.C
new file mode 100644 (file)
index 0000000..a369084
--- /dev/null
@@ -0,0 +1,27 @@
+// PR c++/51852
+// { dg-do compile }
+// { dg-options "-std=gnu++11 --param ggc-min-heapsize=0 --param ggc-min-expand=0" }
+
+template <typename, typename>
+class transformed {};
+
+template <class R, class F>
+transformed<F, R> transform (R r, F f);
+
+template <typename, typename>
+class joined {};
+
+template <typename T, typename U>
+joined<T, U> join (T t, U u);
+
+template <typename T, typename U, typename V, typename... Rest>
+auto join (T t, U u, V v, Rest... rest) -> decltype (join (join (t, u), v, rest...));
+
+template <typename F, typename... Rs>
+auto polymorphic_transform (F f, Rs... rs) -> decltype (join (transform(rs, f)...));
+
+int
+main ()
+{
+  polymorphic_transform (0, 0, 0);
+}