aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-11-13 04:48:05 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-11-13 04:48:05 +0000
commit364460b6fbf1745576733a36d5c52257b596da9a (patch)
treef91251d2f26a7a03b54bffd2af0f10e7e6f1ecdc /gcc
parent2cfcc23e7fa3c0f2fed4e3294794587ef61815ac (diff)
downloadgcc-364460b6fbf1745576733a36d5c52257b596da9a.zip
gcc-364460b6fbf1745576733a36d5c52257b596da9a.tar.gz
gcc-364460b6fbf1745576733a36d5c52257b596da9a.tar.bz2
decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups here.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/semantics.c21
3 files changed, 22 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 96eb09b..4273726 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 83d24c5..fd4361a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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. */
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 31bbd98..83674d1 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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 ();