Commit 45b0c94c by Joseph Myers Committed by Joseph Myers

re PR c/14765 (ice-on-invalid-code, ICE while compiling ({}) expression)

	PR c/14765
	* c-parse.in (compstmt_primary_start): Set last_expr_type to
	NULL_TREE.

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

From-SVN: r82713
parent 3743236e
2004-06-07 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/14765
* c-parse.in (compstmt_primary_start): Set last_expr_type to
NULL_TREE.
2004-06-07 Mark Mitchell <mark@codesourcery.com> 2004-06-07 Mark Mitchell <mark@codesourcery.com>
PR c++/15815 PR c++/15815
......
...@@ -2123,6 +2123,7 @@ compstmt_primary_start: ...@@ -2123,6 +2123,7 @@ compstmt_primary_start:
keep_next_level (); keep_next_level ();
compstmt_count++; compstmt_count++;
$$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree)); $$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree));
last_expr_type = NULL_TREE;
} }
; ;
......
2004-06-07 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/14765
* gcc.dg/pr14765-1.c: New test.
2004-06-07 Roger Sayle <roger@eyesopen.com> 2004-06-07 Roger Sayle <roger@eyesopen.com>
PR c/14649 PR c/14649
......
/* Empty statement expressions should get void type. Bug 14765 from
Serge Belyshev <belyshev@lubercy.com>. */
/* { dg-do compile } */
/* { dg-options "" } */
int a;
void fun ()
{
a = 0;
a = ({}); /* { dg-error "not ignored" "void stmt expr" } */
}
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