re PR c++/36408 (ICE with statement expression in template)
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Jun 2008 06:30:55 +0000 (08:30 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 11 Jun 2008 06:30:55 +0000 (08:30 +0200)
PR c++/36408
* semantics.c (stmt_expr_value_expr): Don't crash on empty
STATEMENT_LIST.

From-SVN: r136651

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

index 74ae4ae4d98d9a82891a243d3403361104d1f272..897a54edb4e3cb216d458e4a139fe5ac05160e67 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/36408
+       * semantics.c (stmt_expr_value_expr): Don't crash on empty
+       STATEMENT_LIST.
+
 2008-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
         PR c++/35242
index 83d23394cb5baa7f3b31ee2861fe9d9bc9f313cf..f39b8d1eb17492d6d8f4792729e8c9d9b3a3c2c0 100644 (file)
@@ -1778,7 +1778,7 @@ stmt_expr_value_expr (tree stmt_expr)
   if (TREE_CODE (t) == BIND_EXPR)
     t = BIND_EXPR_BODY (t);
 
-  if (TREE_CODE (t) == STATEMENT_LIST)
+  if (TREE_CODE (t) == STATEMENT_LIST && STATEMENT_LIST_TAIL (t))
     t = STATEMENT_LIST_TAIL (t)->stmt;
 
   if (TREE_CODE (t) == EXPR_STMT)