summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-03 19:29:51 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-03 19:29:51 +0000
commit81010c9762bdeb5c579ba06d25abdf5adeb2d680 (patch)
treeed397435e12ce43cd81067953111919e1628866f /gcc/c-decl.c
parent6b5829b61cf7053380511862ae06533462bc2a3d (diff)
downloadgcc-81010c9762bdeb5c579ba06d25abdf5adeb2d680.tar.gz
* c-common.c (finish_fname_decls): Put the DECL_STMTs inside the
outermost scope. * c-decl.c (c_make_fname_decl): Push the decls there, too. cp/ * decl.c (cp_make_fname_decl): Push the decls inside the outermost scope. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60848 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 8c86bc0d87a..fde8c482e12 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2545,6 +2545,18 @@ c_make_fname_decl (id, type_dep)
DECL_INITIAL (decl) = init;
TREE_USED (decl) = 1;
+
+ if (current_function_decl)
+ {
+ /* Add the decls to the outermost block. */
+ struct binding_level *b = current_binding_level;
+ struct binding_level *old = b;
+ while (b->level_chain->parm_flag == 0)
+ b = b->level_chain;
+ current_binding_level = b;
+ pushdecl (decl);
+ current_binding_level = old;
+ }
finish_decl (decl, init, NULL_TREE);