From 9de0e916168eb3d8853c02803ce15736164338f4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 11 Jun 2008 08:30:55 +0200 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/semantics.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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) -- 2.30.2