PR c/14069
* c-decl.c (finish_struct): Change type of incorrect flexible array
field into error_mark_node.
Backport from mainline:
2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
* c-typeck.c (output_init_element): Check for type == error_mark_node.
testsuite/
PR c/14069
* gcc.dg/
20040322-1.c: New test.
Backport from mainline:
2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.dg/noncompile/init-4.c: New test.
From-SVN: r80299
+2004-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/14069
+ * c-decl.c (finish_struct): Change type of incorrect flexible array
+ field into error_mark_node.
+
+ Backport from mainline:
+ 2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * c-typeck.c (output_init_element): Check for type == error_mark_node.
+
2004-04-01 Alan Modra <amodra@bigpond.net.au>
* dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants.
&& TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (x))) == NULL_TREE)
{
if (TREE_CODE (t) == UNION_TYPE)
- error_with_decl (x, "flexible array member in union");
+ {
+ error_with_decl (x, "flexible array member in union");
+ TREE_TYPE (x) = error_mark_node;
+ }
else if (TREE_CHAIN (x) != NULL_TREE)
- error_with_decl (x, "flexible array member not at end of struct");
+ {
+ error_with_decl (x, "flexible array member not at end of struct");
+ TREE_TYPE (x) = error_mark_node;
+ }
else if (! saw_named_field)
- error_with_decl (x, "flexible array member in otherwise empty struct");
- }
+ {
+ error_with_decl (x, "flexible array member in otherwise empty struct");
+ TREE_TYPE (x) = error_mark_node;
+ }
+ }
if (pedantic && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
tree value, type, field;
int pending;
{
+ if (type == error_mark_node)
+ {
+ constructor_erroneous = 1;
+ return;
+ }
if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
|| (TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
&& !(TREE_CODE (value) == STRING_CST
+2004-03-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/14069
+ * gcc.dg/20040322-1.c: New test.
+
+ Backport from mainline:
+ 2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * gcc.dg/noncompile/init-4.c: New test.
+
2004-03-25 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20040127-1.c: New test.