summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-26 23:52:09 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-26 23:52:09 +0000
commit1799fbab6a341bb44efe74b182c3e42e71d1ffd7 (patch)
tree8dd23f7d006e9f449c212ce5cea214baccf360b6 /gcc/c-decl.c
parente221246baf59019a4a64f1ad8a1c75c5aa9cc0bd (diff)
downloadgcc-1799fbab6a341bb44efe74b182c3e42e71d1ffd7.tar.gz
PR c/43381
* c-decl.c (get_parm_info): Assert that decl going in OTHERS has a nested binding iff it is a FUNCTION_DECL. (store_parm_decls_newstyle): Pass nested=true to bind for FUNCTION_DECLs amongst parameters. testsuite: * gcc.dg/parm-impl-decl-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index fed04dca9e9..b6ff3f476e6 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6303,6 +6303,11 @@ get_parm_info (bool ellipsis)
type itself. FUNCTION_DECLs appear when there is an implicit
function declaration in the parameter list. */
+ /* When we reinsert this decl in the function body, we need
+ to reconstruct whether it was marked as nested. */
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
+ ? b->nested
+ : !b->nested);
TREE_CHAIN (decl) = others;
others = decl;
/* fall through */
@@ -7624,7 +7629,9 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
DECL_CONTEXT (decl) = current_function_decl;
if (DECL_NAME (decl))
bind (DECL_NAME (decl), decl, current_scope,
- /*invisible=*/false, /*nested=*/false, UNKNOWN_LOCATION);
+ /*invisible=*/false,
+ /*nested=*/(TREE_CODE (decl) == FUNCTION_DECL),
+ UNKNOWN_LOCATION);
}
/* And all the tag declarations. */