Really fix PR c++/36408
authorDodji Seketeli <dodji@redhat.com>
Sun, 29 Nov 2009 19:19:06 +0000 (19:19 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Sun, 29 Nov 2009 19:19:06 +0000 (20:19 +0100)
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.

From-SVN: r154742

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/semantics.c

index ab252ea9804e41dd2bbb92ab8385e881cf308b5d..57ce3cd58ffcd1946c62687b4c8409a3cc71810b 100644 (file)
@@ -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.
index eb1cdd3ca657162013b2c49808001e6faa49c598..dd86ceeb682bc1bf7d5a589db2e5a6857ae78698 100644 (file)
@@ -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;
       }
index 0a1a547d13dc075224bb7e51777c1bbed7a7c43e..4a9bee7162408e14ec458ccb4601dac62c3c15c5 100644 (file)
@@ -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;
 }