Commit 9df594d7 by Richard Guenther Committed by Richard Biener

re PR c/23576 (tree check: expected class ‘type’, have exceptional’ (error_mark)…

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
parent 11e3f4b6
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
......
......@@ -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
......
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
struct ipr_path_entry path[0]; /* { dg-error "array type has incomplete element 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