decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups here.
authorMark Mitchell <mark@codesourcery.com>
Sat, 13 Nov 1999 04:48:05 +0000 (04:48 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 13 Nov 1999 04:48:05 +0000 (04:48 +0000)
* 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.

From-SVN: r30520

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

index 96eb09b1fbc8c3b654f76235fe106eb9e8f54f6a..42737262298f68060363c26f20856df86ddaa5f3 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 83d24c55d125a1d1cab3ef67a48d575d61f16943..fd4361a06ca4b6ae602f0497712caa36aa086230 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 31bbd984a1c1ec60472cdeb00ca45bd57321cf42..83674d1e1e9bbf3fe4456386493cb067b861c937 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 ();