re PR c/23576 (tree check: expected class ‘type’, have exceptional’ (error_mark) in grokdeclarator, at c-decl.c:4252)

2005-10-04  Richard Guenther  <rguenther@suse.de>

	PR c/23576
	* c-decl.c (grokdeclarator): Don't write to fields
	of error_mark_node.

	* gcc.dg/noncompile/pr23576.c: New testcase.

From-SVN: r104943
This commit is contained in:
Richard Guenther 2005-10-04 13:58:42 +00:00 committed by Richard Biener
parent 11e3f4b6f7
commit 9df594d7e7
4 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2005-10-04 Richard Guenther <rguenther@suse.de>
PR c/23576
* c-decl.c (grokdeclarator): Don't write to fields
of error_mark_node.
2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23125

View File

@ -4248,16 +4248,19 @@ grokdeclarator (const struct c_declarator *declarator,
else
type = build_array_type (type, itype);
if (size_varies)
C_TYPE_VARIABLE_SIZE (type) = 1;
/* The GCC extension for zero-length arrays differs from
ISO flexible array members in that sizeof yields
zero. */
if (size && integer_zerop (size))
if (type != error_mark_node)
{
TYPE_SIZE (type) = bitsize_zero_node;
TYPE_SIZE_UNIT (type) = size_zero_node;
if (size_varies)
C_TYPE_VARIABLE_SIZE (type) = 1;
/* The GCC extension for zero-length arrays differs from
ISO flexible array members in that sizeof yields
zero. */
if (size && integer_zerop (size))
{
TYPE_SIZE (type) = bitsize_zero_node;
TYPE_SIZE_UNIT (type) = size_zero_node;
}
}
if (decl_context != PARM

View File

@ -1,3 +1,8 @@
2005-10-04 Richard Guenther <rguenther@suse.de>
PR c/23576
* gcc.dg/noncompile/pr23576.c: New testcase.
2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23125

View File

@ -0,0 +1 @@
struct ipr_path_entry path[0]; /* { dg-error "array type has incomplete element type" } */