semantics.c (begin_for_stmt): Push the 'for' scope before adding the FOR_STMT.
authorJason Merrill <jason@redhat.com>
Tue, 18 Jun 2002 16:21:25 +0000 (12:21 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 18 Jun 2002 16:21:25 +0000 (12:21 -0400)
        * semantics.c (begin_for_stmt): Push the 'for' scope before
        adding the FOR_STMT.

From-SVN: r54749

gcc/cp/ChangeLog
gcc/cp/semantics.c

index 21ced62e840832edd0cbdb7b99cbad9a0e66c9d5..2572a5627ba5a6725c119128e0ce2a2f39be4934 100644 (file)
@@ -1,5 +1,8 @@
 2002-06-14  Jason Merrill  <jason@redhat.com>
 
+       * semantics.c (begin_for_stmt): Push the 'for' scope before
+       adding the FOR_STMT.
+
        C++ ABI changes.
        * class.c (build_base_field): Set DECL_PACKED.
        (layout_class_type): Don't use tail padding of PODs.
index bbc22037ecef153ace1943ba945d3d39b3cdf8b1..c6c304753f39d58fcccb6e2bd1e76f16428be2ed 100644 (file)
@@ -417,12 +417,12 @@ begin_for_stmt ()
   r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE, 
                  NULL_TREE, NULL_TREE);
   NEW_FOR_SCOPE_P (r) = flag_new_for_scope > 0;
-  add_stmt (r);
   if (NEW_FOR_SCOPE_P (r))
     {
       do_pushlevel ();
       note_level_for_for ();
     }
+  add_stmt (r);
 
   return r;
 }