Commit 694fea20 by Volker Reichelt Committed by Volker Reichelt

re PR c/27420 (ICE on invalid function definition)

	PR c/27420
	* c-common.c (self_promoting_args_p): Skip erroneous args.

	* gcc.dg/func-args-2.c: New test.

From-SVN: r113976
parent 4271a6f3
2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27420
* c-common.c (self_promoting_args_p): Skip erroneous args.
PR c/26818 PR c/26818
* c-decl.c (finish_struct): Skip erroneous fields. * c-decl.c (finish_struct): Skip erroneous fields.
......
...@@ -3547,6 +3547,9 @@ self_promoting_args_p (tree parms) ...@@ -3547,6 +3547,9 @@ self_promoting_args_p (tree parms)
{ {
tree type = TREE_VALUE (t); tree type = TREE_VALUE (t);
if (type == error_mark_node)
continue;
if (TREE_CHAIN (t) == 0 && type != void_type_node) if (TREE_CHAIN (t) == 0 && type != void_type_node)
return 0; return 0;
......
2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27420
* gcc.dg/func-args-2.c: New test.
PR c/26818 PR c/26818
* gcc.dg/struct-incompl-1.c: New test. * gcc.dg/struct-incompl-1.c: New test.
/* PR c/27420 */
/* { dg-do compile } */
/* { dg-options "-w" } */
void foo();
void foo(struct A a) {} /* { dg-error "incomplete type" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment