re PR c/27953 (ICE with invalid function definitions)

PR c/27953
	* c-decl.c (store_parm_decls_oldstyle): Robustify
        * gcc.dg/pr27953.c: New test.

From-SVN: r119446
This commit is contained in:
Lee Millward 2006-12-02 16:34:26 +00:00 committed by Lee Millward
parent cc0faf9dc9
commit f1f66b423f
4 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-12-02 Lee Millward <lee.millward@codesourcery.com>
PR c/27953
* c-decl.c (store_parm_decls_oldstyle): Robustify.
2006-11-30 Jan Hubicka <jh@suse.cz>
Uros Bizjak <ubizjak@gmail.com>

View File

@ -6482,8 +6482,8 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
tree type;
for (parm = DECL_ARGUMENTS (fndecl),
type = current_function_prototype_arg_types;
parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type))
!= void_type_node));
parm || (type && TREE_VALUE (type) != error_mark_node
&& (TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node));
parm = TREE_CHAIN (parm), type = TREE_CHAIN (type))
{
if (parm == 0 || type == 0

View File

@ -1,3 +1,8 @@
2006-12-02 Lee Millward <lee.millward@codesourcery.com>
PR c/27953
* gcc.dg/pr27953.c: New test.
2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/30022

View File

@ -0,0 +1,4 @@
/* PR c/27953 */
void foo(struct A a) {} /* { dg-error "parameter list|definition|incomplete type" } */
void foo() {} /* { dg-error "redefinition" }