From: Jakub Jelinek Date: Wed, 11 Jun 2008 06:30:55 +0000 (+0200) Subject: re PR c++/36408 (ICE with statement expression in template) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9de0e916168eb3d8853c02803ce15736164338f4;p=gcc.git re PR c++/36408 (ICE with statement expression in template) PR c++/36408 * semantics.c (stmt_expr_value_expr): Don't crash on empty STATEMENT_LIST. From-SVN: r136651 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 74ae4ae4d98..897a54edb4e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-06-09 Jakub Jelinek + + PR c++/36408 + * semantics.c (stmt_expr_value_expr): Don't crash on empty + STATEMENT_LIST. + 2008-06-08 Paolo Carlini PR c++/35242 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 83d23394cb5..f39b8d1eb17 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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)