commit a881d7bf5eb64ee5f110ae0ff206805da560f3df
Author: Jason Merrill <jason@redhat.com>
Date: Wed Nov 11 15:48:01 2015 -0500
* pt.c (instantiate_class_template_1): Set function_depth around
instantiation of lambda op().
@@ -10168,7 +10168,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