From 560ad30812da70455b371b0488229beab9ae9d75 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 23 Feb 2012 17:34:02 +0100 Subject: re PR c/52290 (internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712) PR c/52290 * c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL. testsuite/ChangeLog: PR c/52290 * gcc.dg/noncompile/pr52290.c: New test. From-SVN: r184511 --- gcc/c-decl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 93fb16d..de46578 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, /* If the declarator is not suitable for a function definition, cause a syntax error. */ - if (decl1 == 0) + if (decl1 == 0 + || TREE_CODE (decl1) != FUNCTION_DECL) return 0; loc = DECL_SOURCE_LOCATION (decl1); -- cgit v1.1