]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/51662 (Temporary objects gets garbage collected in cc1plus)
authorJason Merrill <jason@redhat.com>
Thu, 29 Nov 2012 21:58:04 +0000 (16:58 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 29 Nov 2012 21:58:04 +0000 (16:58 -0500)
PR c++/51662
* method.c (process_subob_fn): Increment function_depth around call to
instantiate_decl.

From-SVN: r193969

gcc/cp/ChangeLog
gcc/cp/method.c

index f93ab4a104e732da01a8553da4e0318191dcec5e..e2642a9c8f3de7d3951998e0c562d96efa3a66da 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51662
+       * method.c (process_subob_fn): Increment function_depth around call to
+       instantiate_decl.
+
 2012-11-29  Kai Tietz  <ktietz@redhat.com>
 
        PR target/53912
index f7198d59077abc16f5aa52c60bafba2dd65605ef..177948a44383e15f6bd8c655430107fe4b630161 100644 (file)
@@ -952,7 +952,11 @@ process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
         really constexpr.  */
       if (DECL_DECLARED_CONSTEXPR_P (fn) && DECL_TEMPLATE_INSTANTIATION (fn)
          && !DECL_TEMPLATE_INSTANTIATED (fn))
-       instantiate_decl (fn, /*defer_ok*/false, /*expl_class*/false);
+       {
+         ++function_depth;
+         instantiate_decl (fn, /*defer_ok*/false, /*expl_class*/false);
+         --function_depth;
+       }
       if (!DECL_DECLARED_CONSTEXPR_P (fn))
        *constexpr_p = false;
     }