From e00dceafd2de848a7735dbce48922aa2304a0f94 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 29 Jul 2016 17:36:46 +0000 Subject: 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 --- gcc/c/c-decl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/c/c-decl.c') 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 -- cgit v1.1