diff options
author | Marek Polacek <polacek@redhat.com> | 2015-02-27 12:18:57 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-02-27 12:18:57 +0000 |
commit | e5165b604cb5af9ea1478b37194c1398204f61e3 (patch) | |
tree | 9c0c725875a7c75f07fc45e1b243484797cf2c45 /gcc/c | |
parent | a2a5609b4bac11a8dec713f42cd39193d4336a74 (diff) | |
download | gcc-e5165b604cb5af9ea1478b37194c1398204f61e3.zip gcc-e5165b604cb5af9ea1478b37194c1398204f61e3.tar.gz gcc-e5165b604cb5af9ea1478b37194c1398204f61e3.tar.bz2 |
re PR c/65228 (ICE: expected tree that contains ‘decl minimal’ structure, have ‘error_mark’ in start_decl)
PR c/65228
* c-decl.c (start_decl): Return NULL_TREE if decl is an error node.
* gcc.dg/pr65228.c: New test.
From-SVN: r221056
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 0bb5dc7..7152fc0 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2015-02-27 Marek Polacek <polacek@redhat.com> + + PR c/65228 + * c-decl.c (start_decl): Return NULL_TREE if decl is an error node. + 2015-02-14 Marek Polacek <polacek@redhat.com> PR c/64768 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 8eeee9c..7497858 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -4460,8 +4460,8 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, NULL, &attributes, &expr, NULL, deprecated_state); - if (!decl) - return 0; + if (!decl || decl == error_mark_node) + return NULL_TREE; if (expr) add_stmt (fold_convert (void_type_node, expr)); |