From: Jason Merrill Date: Wed, 8 Jun 2011 13:08:45 +0000 (-0400) Subject: pt.c (deduction_tsubst_fntype): Don't free the tinst entry if a pending_template... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29f445bca0097771a52c7558f38d2fe287be2419;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5b47f21d262..eb6dde0072a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-06-08 Jason Merrill + + 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 PR c++/48969 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f93fa7fd6cc..61ca31c9ecc 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; }