OSDN Git Service

* cp-tree.h (finish_stmt_expr): Change prototype.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Sep 1999 21:26:06 +0000 (21:26 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Sep 1999 21:26:06 +0000 (21:26 +0000)
* expr.c (cplus_expand_expr): Adjust call accordingly.
* init.c (finish_init_stmts): Likewise.
* parse.y (primary): Likewise.
* pt.c (tsubst_copy): Likewise.
* semantics.c (finish_stmt_expr): Don't take two parameters.
Don't remove generated BLOCKs from the block-tree.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29533 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/expr.c
gcc/cp/init.c
gcc/cp/parse.y
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C [new file with mode: 0644]

index 5f0bce0..624e01c 100644 (file)
@@ -1,5 +1,13 @@
 1999-09-20  Mark Mitchell  <mark@codesourcery.com>
 
+       * cp-tree.h (finish_stmt_expr): Change prototype.
+       * expr.c (cplus_expand_expr): Adjust call accordingly.
+       * init.c (finish_init_stmts): Likewise.
+       * parse.y (primary): Likewise.
+       * pt.c (tsubst_copy): Likewise.
+       * semantics.c (finish_stmt_expr): Don't take two parameters.
+       Don't remove generated BLOCKs from the block-tree.
+
        Remove support for assigning to `this'.
        * NEWS: Note that fact.
        * class.c (build_vbase_path): Don't check flag_this_is_variable.
index 9a55744..8744b7f 100644 (file)
@@ -3674,7 +3674,7 @@ extern void finish_label_decl                   PROTO((tree));
 extern void finish_subobject                    PROTO((tree));
 extern tree finish_parenthesized_expr           PROTO((tree));
 extern tree begin_stmt_expr                     PROTO((void));
-extern tree finish_stmt_expr                    PROTO((tree, tree));
+extern tree finish_stmt_expr                    PROTO((tree));
 extern tree finish_call_expr                    PROTO((tree, tree, int));
 extern tree finish_increment_expr               PROTO((tree, enum tree_code));
 extern tree finish_this_expr                    PROTO((void));
index 1f38649..0eb5de4 100644 (file)
@@ -245,8 +245,8 @@ cplus_expand_expr (exp, target, tmode, modifier)
     case STMT_EXPR:
       {
        tree rtl_expr = begin_stmt_expr ();
-       tree block = expand_stmt (STMT_EXPR_STMT (exp));
-       finish_stmt_expr (rtl_expr, block);
+       expand_stmt (STMT_EXPR_STMT (exp));
+       finish_stmt_expr (rtl_expr);
        return expand_expr (rtl_expr, target, tmode, modifier);
       }
       break;
index 11b96c4..c98324e 100644 (file)
@@ -990,10 +990,8 @@ finish_init_stmts (stmt_expr, compound_stmt)
      tree compound_stmt;
 {
   pop_momentary ();
-  stmt_expr 
-    = finish_stmt_expr (stmt_expr,
-                       finish_compound_stmt (/*has_no_scope=*/1, 
-                                             compound_stmt));
+  finish_compound_stmt (/*has_no_scope=*/1, compound_stmt);
+  stmt_expr = finish_stmt_expr (stmt_expr);
 
   /* To avoid spurious warnings about unused values, we set 
      TREE_USED.  */
index ce697d4..c3892ed 100644 (file)
@@ -1446,7 +1446,7 @@ primary:
                  $<ttype>$ = begin_stmt_expr (); 
                }
          compstmt ')'
-               { $$ = finish_stmt_expr ($<ttype>2, $3); }
+               { $$ = finish_stmt_expr ($<ttype>2); }
         /* Koenig lookup support
            We could store lastiddecl in $1 to avoid another lookup,
            but that would result in many additional reduce/reduce conflicts. */
index e7f35fa..3fca3d8 100644 (file)
@@ -7085,9 +7085,9 @@ tsubst_copy (t, args, complain, in_decl)
       if (!processing_template_decl)
        {
          tree rtl_expr = begin_stmt_expr ();
-         tree block = tsubst_expr (STMT_EXPR_STMT (t), args,
-                                   complain, in_decl);
-         return finish_stmt_expr (rtl_expr, block);
+         tsubst_expr (STMT_EXPR_STMT (t), args,
+                      complain, in_decl);
+         return finish_stmt_expr (rtl_expr);
        }
       
       return t;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C
new file mode 100644 (file)
index 0000000..db73cd7
--- /dev/null
@@ -0,0 +1,10 @@
+// Build don't link:
+// Special g++ Options: -O
+// Origin: Thomas Kunert <kunert@physik.tu-dresden.de>
+
+#include <ctype.h>
+bool  f( char c )
+{
+    return tolower( c );
+}