From: Joseph Myers Date: Mon, 7 Jun 2004 19:49:31 +0000 (+0100) Subject: re PR c/14765 (ice-on-invalid-code, ICE while compiling ({}) expression) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45b0c94cb45aefa68b1627f8a76a84bad2d5b717;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a277a4d9f9e..7a5323007be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-06-07 Joseph S. Myers + + PR c/14765 + * c-parse.in (compstmt_primary_start): Set last_expr_type to + NULL_TREE. + 2004-06-07 Mark Mitchell PR c++/15815 diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 9e776fa3e21..b89c19d80b6 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -2123,6 +2123,7 @@ compstmt_primary_start: keep_next_level (); compstmt_count++; $$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree)); + last_expr_type = NULL_TREE; } ; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cbb0c496b23..bd4048b83d1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-06-07 Joseph S. Myers + + PR c/14765 + * gcc.dg/pr14765-1.c: New test. + 2004-06-07 Roger Sayle PR c/14649 diff --git a/gcc/testsuite/gcc.dg/pr14765-1.c b/gcc/testsuite/gcc.dg/pr14765-1.c new file mode 100644 index 00000000000..d2b341839ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr14765-1.c @@ -0,0 +1,11 @@ +/* Empty statement expressions should get void type. Bug 14765 from + Serge Belyshev . */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +int a; +void fun () +{ + a = 0; + a = ({}); /* { dg-error "not ignored" "void stmt expr" } */ +}