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
This commit is contained in:
Jakub Jelinek 2008-06-11 08:30:55 +02:00 committed by Jakub Jelinek
parent 976e44e324
commit 9de0e91616
2 changed files with 7 additions and 1 deletions

View 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

View 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)