re PR c++/35747 (ICE with undefined variable in statement expression)

PR c++/35747
	* semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
	expression is errorneous.

	* g++.dg/ext/stmtexpr13.C: New test.

From-SVN: r134567
This commit is contained in:
Jakub Jelinek 2008-04-23 00:06:58 +02:00 committed by Jakub Jelinek
parent b2f06c39b0
commit d7b5fa3150
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-04-22 Jakub Jelinek <jakub@redhat.com>
PR c++/35747
* semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
expression is errorneous.
2008-04-21 Jason Merrill <jason@redhat.com>
PR c++/35325

View File

@ -1739,7 +1739,10 @@ finish_stmt_expr (tree stmt_expr, bool has_no_scope)
tree result;
if (error_operand_p (stmt_expr))
return error_mark_node;
{
pop_stmt_list (stmt_expr);
return error_mark_node;
}
gcc_assert (TREE_CODE (stmt_expr) == STATEMENT_LIST);

View File

@ -1,3 +1,8 @@
2008-04-22 Jakub Jelinek <jakub@redhat.com>
PR c++/35747
* g++.dg/ext/stmtexpr13.C: New test.
2008-04-22 Ian Lance Taylor <iant@google.com>
* gcc.c-torture/compile/20080419-1.c: New test.

View File

@ -0,0 +1,9 @@
// PR c++/35747
// { dg-do compile }
// { dg-options "" }
void
foo ()
{
({ i; ({ i; }); 0; }); // { dg-error "was not declared" }
}