From c37833995fe3eeb6c163ad80221c4ff2e7172422 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 25 Jul 2000 19:36:26 +0000 Subject: [PATCH] decl.c (poplevel): Deal with anonymous variables at for scope. * decl.c (poplevel): Deal with anonymous variables at for scope. (maybe_inject_for_scope_var): Likewise. From-SVN: r35250 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a221131cf53..a55e7d8ebd0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-07-25 Nathan Sidwell + + * decl.c (poplevel): Deal with anonymous variables at for scope. + (maybe_inject_for_scope_var): Likewise. + 2000-07-25 Zack Weinberg * decl.c: Remove all signal handling code, now done in toplev.c. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bd64e2ea441..6c77b9f08d6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1441,7 +1441,8 @@ poplevel (keep, reverse, functionbody) /* Remove declarations for all the DECLs in this level. */ for (link = decls; link; link = TREE_CHAIN (link)) { - if (leaving_for_scope && TREE_CODE (link) == VAR_DECL) + if (leaving_for_scope && TREE_CODE (link) == VAR_DECL + && DECL_NAME (link)) { tree outer_binding = TREE_CHAIN (IDENTIFIER_BINDING (DECL_NAME (link))); @@ -7843,6 +7844,9 @@ void maybe_inject_for_scope_var (decl) tree decl; { + if (!DECL_NAME (decl)) + return; + if (current_binding_level->is_for_scope) { struct binding_level *outer -- 2.30.2