From: Jason Merrill Date: Thu, 29 Nov 2012 21:58:04 +0000 (-0500) Subject: re PR c++/51662 (Temporary objects gets garbage collected in cc1plus) X-Git-Tag: releases/gcc-4.6.4~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0078f2869e8ef66d2734e0c91374fec445a5d965;p=thirdparty%2Fgcc.git re PR c++/51662 (Temporary objects gets garbage collected in cc1plus) PR c++/51662 * method.c (process_subob_fn): Increment function_depth around call to instantiate_decl. From-SVN: r193969 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f93ab4a104e7..e2642a9c8f3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-11-29 Jason Merrill + + PR c++/51662 + * method.c (process_subob_fn): Increment function_depth around call to + instantiate_decl. + 2012-11-29 Kai Tietz PR target/53912 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index f7198d59077a..177948a44383 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -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; }