* decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 04:48:05 +0000 (04:48 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 04:48:05 +0000 (04:48 +0000)
here.
* semantics.c (finish_expr_stmt): Call it here instead.  Move
default_conversion logic to semantic-analysis time.

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

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

index 96eb09b..4273726 100644 (file)
@@ -1,3 +1,10 @@
+1999-11-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
+       here.
+       * semantics.c (finish_expr_stmt): Call it here instead.  Move
+       default_conversion logic to semantic-analysis time.
+
 1999-11-12  Jason Merrill  <jason@yorick.cygnus.com>
 
        * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
index 83d24c5..fd4361a 100644 (file)
@@ -14155,7 +14155,7 @@ cplus_expand_expr_stmt (exp)
      trying to do TYPE_MODE on the ERROR_MARK, and really
      go outside the bounds of the type.  */
   if (exp != error_mark_node)
-    expand_expr_stmt (break_out_cleanups (exp));
+    expand_expr_stmt (exp);
 }
 
 /* When a stmt has been parsed, this function is called.  */
index 31bbd98..83674d1 100644 (file)
@@ -127,18 +127,25 @@ finish_expr_stmt (expr)
   if (expr != NULL_TREE)
     {
       if (building_stmt_tree ())
-       add_tree (build_min_nt (EXPR_STMT, expr));
-      else
        {
-         emit_line_note (input_filename, lineno);
          /* Do default conversion if safe and possibly important,
             in case within ({...}).  */
-         if (!stmts_are_full_exprs_p &&
-             ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
-               && lvalue_p (expr))
-              || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
+         if (!processing_template_decl
+             && !stmts_are_full_exprs_p
+             && ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
+                  && lvalue_p (expr))
+                 || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
            expr = default_conversion (expr);
 
+         if (!processing_template_decl)
+           expr = break_out_cleanups (expr);
+
+         add_tree (build_min_nt (EXPR_STMT, expr));
+       }
+      else
+       {
+         emit_line_note (input_filename, lineno);
+
          if (stmts_are_full_exprs_p)
            expand_start_target_temps ();