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
This commit is contained in:
Jason Merrill 2015-11-11 19:53:19 -05:00 committed by Jason Merrill
parent 65b016eb13
commit c7360ed2f9
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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