Commit 26d8af35 by Joseph Myers Committed by Joseph Myers

re PR c/40033 (ICE with invalid statement expression)

	PR c/40033
	* c-typeck.c (c_finish_stmt_expr): Do not wrap error_mark_node in
	a C_MAYBE_CONST_EXPR.

testsuite:
	* gcc.dg/noncompile/pr40033-1.c: New test.

From-SVN: r153522
parent 5e86b38c
2009-10-23 Joseph Myers <joseph@codesourcery.com>
PR c/40033
* c-typeck.c (c_finish_stmt_expr): Do not wrap error_mark_node in
a C_MAYBE_CONST_EXPR.
2009-10-23 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/41787
......@@ -8653,11 +8653,13 @@ c_finish_stmt_expr (location_t loc, tree body)
goto continue_searching;
}
if (last == error_mark_node)
return last;
/* In the case that the BIND_EXPR is not necessary, return the
expression out from inside it. */
if (last == error_mark_node
|| (last == BIND_EXPR_BODY (body)
&& BIND_EXPR_VARS (body) == NULL))
if (last == BIND_EXPR_BODY (body)
&& BIND_EXPR_VARS (body) == NULL)
{
/* Even if this looks constant, do not allow it in a constant
expression. */
......
2009-10-23 Joseph Myers <joseph@codesourcery.com>
PR c/40033
* gcc.dg/noncompile/pr40033-1.c: New test.
2009-10-23 Dodji Seketeli <dodji@redhat.com>
PR c++/40808
......
/* ICE from error_mark_node being wrapped in a C_MAYBE_CONST_EXPR. PR
40033. */
void foo()
{
({ 0,; }); /* { dg-error "expected" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment