diff options
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2b20bf9..fbb8db7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4335,9 +4335,6 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep) if (name) free (CONST_CAST (char *, name)); - /* As we're using pushdecl_with_scope, we must set the context. */ - DECL_CONTEXT (decl) = current_function_decl; - TREE_STATIC (decl) = 1; TREE_READONLY (decl) = 1; DECL_ARTIFICIAL (decl) = 1; @@ -4346,12 +4343,8 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep) if (current_function_decl) { - cp_binding_level *b = current_binding_level; - if (b->kind == sk_function_parms) - return error_mark_node; - while (b->level_chain->kind != sk_function_parms) - b = b->level_chain; - pushdecl_with_scope (decl, b, /*is_friend=*/false); + DECL_CONTEXT (decl) = current_function_decl; + decl = pushdecl_outermost_localscope (decl); cp_finish_decl (decl, init, /*init_const_expr_p=*/false, NULL_TREE, LOOKUP_ONLYCONVERTING); } |