+2017-09-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/82070 - error with nested lambda capture
+ * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
+ register_local_specialization.
+
2017-09-06 Nathan Sidwell <nathan@acm.org>
* name-lookup.h (lookup_field_1): Delete.
else if (is_capture_proxy (decl)
&& !DECL_TEMPLATE_INSTANTIATION (current_function_decl))
{
- /* We're in tsubst_lambda_expr, we've already inserted new capture
- proxies, and uses will find them with lookup_name. */
+ /* We're in tsubst_lambda_expr, we've already inserted a new
+ capture proxy, so look it up and register it. */
+ tree inst = lookup_name (DECL_NAME (decl));
+ gcc_assert (inst != decl && is_capture_proxy (inst));
+ register_local_specialization (inst, decl);
break;
}
else if (DECL_IMPLICIT_TYPEDEF_P (decl)