aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-11-11 19:53:19 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-11-11 19:53:19 -0500
commitc7360ed2f9b78a0091b6ce60e8ef7411683efae2 (patch)
tree62c5656bb48181a683ba987c40941cf4f44a15cf /gcc
parent65b016eb13b67dd990f30a55948a623d9deadd11 (diff)
downloadgcc-c7360ed2f9b78a0091b6ce60e8ef7411683efae2.zip
gcc-c7360ed2f9b78a0091b6ce60e8ef7411683efae2.tar.gz
gcc-c7360ed2f9b78a0091b6ce60e8ef7411683efae2.tar.bz2
pt.c (instantiate_class_template_1): Set function_depth around instantiation of lambda op().
* pt.c (instantiate_class_template_1): Set function_depth around instantiation of lambda op(). From-SVN: r230201
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 62992ee..9cbda29 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-11 Jason Merrill <jason@redhat.com>
+
+ * pt.c (instantiate_class_template_1): Set function_depth around
+ instantiation of lambda op().
+
2015-11-11 Marek Polacek <polacek@redhat.com>
PR c/68107
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 053a4ef..62659ec 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10162,7 +10162,12 @@ instantiate_class_template_1 (tree type)
{
if (!DECL_TEMPLATE_INFO (decl)
|| DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (decl)) != decl)
- instantiate_decl (decl, false, false);
+ {
+ /* Set function_depth to avoid garbage collection. */
+ ++function_depth;
+ instantiate_decl (decl, false, false);
+ --function_depth;
+ }
/* We need to instantiate the capture list from the template
after we've instantiated the closure members, but before we