aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 46ab30f..5061597 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -295,24 +295,13 @@ is_normal_capture_proxy (tree decl)
void
insert_capture_proxy (tree var)
{
- cp_binding_level *b;
- tree stmt_list;
-
/* Put the capture proxy in the extra body block so that it won't clash
with a later local variable. */
- b = current_binding_level;
- for (;;)
- {
- cp_binding_level *n = b->level_chain;
- if (n->kind == sk_function_parms)
- break;
- b = n;
- }
- pushdecl_with_scope (var, b, false);
+ pushdecl_outermost_localscope (var);
/* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */
var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var);
- stmt_list = (*stmt_list_stack)[1];
+ tree stmt_list = (*stmt_list_stack)[1];
gcc_assert (stmt_list);
append_to_statement_list_force (var, &stmt_list);
}