summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-29 19:19:06 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-29 19:19:06 +0000
commit7a86e244d0df52d6a875d0bad926fb79718174e2 (patch)
tree3632d82bf55ed91d3882acab5dbdf5de9aee1a6e
parent6d669bf9e3abf20ef4f7f0d30ce8926533f24d3a (diff)
downloadgcc-7a86e244d0df52d6a875d0bad926fb79718174e2.tar.gz
Really fix PR c++/36408
gcc/cp/ChangeLog: PR c++/36408 * semantics.c (empty_expr_stmt_p): Handle void_zero_node and fix bad indentation. * pt.c (tsubst_copy_and_build): Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154742 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/cp/semantics.c17
3 files changed, 19 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ab252ea9804..57ce3cd58ff 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-29 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/36408
+ * semantics.c (empty_expr_stmt_p): Handle void_zero_node and fix
+ bad indentation.
+ * pt.c (tsubst_copy_and_build): Fix typo.
+
2009-11-29 Jan Hubicka <jh@suse.cz>
* optimize.c (maybe_clone_body): Emit thunks associated to alias.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index eb1cdd3ca65..dd86ceeb682 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -12546,8 +12546,8 @@ tsubst_copy_and_build (tree t,
/* If the resulting list of expression statement is empty,
fold it further into void_zero_node. */
- if (empty_expr_stmt_p (cur_stmt_expr))
- cur_stmt_expr = void_zero_node;
+ if (empty_expr_stmt_p (stmt_expr))
+ stmt_expr = void_zero_node;
return stmt_expr;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 0a1a547d13d..4a9bee71624 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1855,6 +1855,9 @@ empty_expr_stmt_p (tree expr_stmt)
{
tree body = NULL_TREE;
+ if (expr_stmt == void_zero_node)
+ return true;
+
if (expr_stmt)
{
if (TREE_CODE (expr_stmt) == EXPR_STMT)
@@ -1863,13 +1866,13 @@ empty_expr_stmt_p (tree expr_stmt)
body = expr_stmt;
}
- if (body)
- {
- if (TREE_CODE (body) == STATEMENT_LIST)
- return tsi_end_p (tsi_start (body));
- else
- return empty_expr_stmt_p (body);
- }
+ if (body)
+ {
+ if (TREE_CODE (body) == STATEMENT_LIST)
+ return tsi_end_p (tsi_start (body));
+ else
+ return empty_expr_stmt_p (body);
+ }
return false;
}