decl.c (poplevel): Deal with anonymous variables at for scope.
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 25 Jul 2000 19:36:26 +0000 (19:36 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 25 Jul 2000 19:36:26 +0000 (19:36 +0000)
* decl.c (poplevel): Deal with anonymous variables at for scope.
(maybe_inject_for_scope_var): Likewise.

From-SVN: r35250

gcc/cp/ChangeLog
gcc/cp/decl.c

index a221131cf53751b2617ca88f917e4d0959e9bd14..a55e7d8ebd0c63df48fad4e137a19373ad8a9663 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-25  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * decl.c (poplevel): Deal with anonymous variables at for scope.
+       (maybe_inject_for_scope_var): Likewise.
+
 2000-07-25  Zack Weinberg  <zack@wolery.cumb.org>
 
        * decl.c: Remove all signal handling code, now done in toplev.c.
index bd64e2ea441e80a35559d397e20e8f916b2514cd..6c77b9f08d657c9cce04e0607e39afad8e33d8f1 100644 (file)
@@ -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