aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-08 09:08:45 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-08 09:08:45 -0400
commit29f445bca0097771a52c7558f38d2fe287be2419 (patch)
tree7be2674888abd131ab606e3c9c92be3825be5cea
parentd9c77712d5b14e131210303ffbef49096ae613d1 (diff)
downloadgcc-29f445bca0097771a52c7558f38d2fe287be2419.zip
gcc-29f445bca0097771a52c7558f38d2fe287be2419.tar.gz
gcc-29f445bca0097771a52c7558f38d2fe287be2419.tar.bz2
pt.c (deduction_tsubst_fntype): Don't free the tinst entry if a pending_template entry is pointing at it.
* pt.c (deduction_tsubst_fntype): Don't free the tinst entry if a pending_template entry is pointing at it. From-SVN: r174807
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5b47f21..eb6dde0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/49322
+ * pt.c (deduction_tsubst_fntype): Don't free the tinst entry
+ if a pending_template entry is pointing at it.
+
2011-06-07 Jason Merrill <jason@redhat.com>
PR c++/48969
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f93fa7f..61ca31c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13611,6 +13611,7 @@ deduction_tsubst_fntype (tree fn, tree targs)
static bool excessive_deduction_depth;
static int deduction_depth;
location_t save_loc = input_location;
+ struct pending_template *old_last_pend = last_pending_template;
tree fntype = TREE_TYPE (fn);
tree tinst;
@@ -13644,7 +13645,9 @@ deduction_tsubst_fntype (tree fn, tree targs)
}
pop_tinst_level ();
- ggc_free (tinst);
+ /* We can't free this if a pending_template entry is pointing at it. */
+ if (last_pending_template == old_last_pend)
+ ggc_free (tinst);
return r;
}