PR c/21213
* c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of
transparent union.
testsuite:
* gcc.dg/transparent-union-3.c: New test.
From-SVN: r99063
+2005-05-01 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/21213
+ * c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of
+ transparent union.
+
2005-05-01 Joseph S. Myers <joseph@codesourcery.com>
PR c/20740
make it one, warn and turn off the flag. */
if (TREE_CODE (t) == UNION_TYPE
&& TYPE_TRANSPARENT_UNION (t)
- && TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t)))
+ && (!TYPE_FIELDS (t) || TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t))))
{
TYPE_TRANSPARENT_UNION (t) = 0;
warning ("union cannot be made transparent");
+2005-05-01 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/21213
+ * gcc.dg/transparent-union-3.c: New test.
+
2005-05-01 Joseph S. Myers <joseph@codesourcery.com>
PR c/20740