diff options
author | Marek Polacek <polacek@redhat.com> | 2016-07-29 17:36:46 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-07-29 17:36:46 +0000 |
commit | e00dceafd2de848a7735dbce48922aa2304a0f94 (patch) | |
tree | feeb7bcc2ca33fc90b3d2193ab87d8641f9730a2 /gcc/c | |
parent | efd0786f218626c25adde976a9f83121b0c45342 (diff) | |
download | gcc-e00dceafd2de848a7735dbce48922aa2304a0f94.zip gcc-e00dceafd2de848a7735dbce48922aa2304a0f94.tar.gz gcc-e00dceafd2de848a7735dbce48922aa2304a0f94.tar.bz2 |
re PR c/71573 (ICE on invalid C code on x86_64-linux-gnu (tree check: expected function_decl, have var_decl in implicitly_declare))
PR c/71573
* c-decl.c (implicitly_declare): Return decl early not only for
error_mark_nodes, but for anything that is not a FUNCTION_DECL.
* gcc.dg/noncompile/pr71573.c: New test.
From-SVN: r238885
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ec680d3..0650758 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -7,6 +7,10 @@ * c-parser.c (c_parser_switch_statement): Initialize ce.original_type to error node for invalid code. + PR c/71573 + * c-decl.c (implicitly_declare): Return decl early not only for + error_mark_nodes, but for anything that is not a FUNCTION_DECL. + 2016-07-29 Jakub Jelinek <jakub@redhat.com> PR c/71969 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 9a922cc..5f38985 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -3327,7 +3327,7 @@ implicitly_declare (location_t loc, tree functionid) if (decl) { - if (decl == error_mark_node) + if (TREE_CODE (decl) != FUNCTION_DECL) return decl; /* FIXME: Objective-C has weird not-really-builtin functions |