+2002-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/6660
+ * c-decl.c (grokfield): Allow user defined types if they declare
+ structs or unions for unnamed fields.
+
2002-06-10 Jakub Jelinek <jakub@redhat.com>
PR c/6809
{
/* This is an unnamed decl. We only support unnamed
structs/unions, so check for other things and refuse them. */
- if (TREE_CODE (TREE_VALUE (declspecs)) != RECORD_TYPE
- && TREE_CODE (TREE_VALUE (declspecs)) != UNION_TYPE)
+ tree type = TREE_VALUE (declspecs);
+
+ if (TREE_CODE (type) == TYPE_DECL)
+ type = TREE_TYPE (type);
+ if (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE)
{
error ("unnamed fields of type other than struct or union are not allowed");
return NULL_TREE;
* gcc.dg/20020530-1.c: New test.
+ * gcc.dg/20020527-1.c: New test.
+
2002-05-29 Hans-Peter Nilsson <hp@axis.com>
* gcc.c-torture/execute/20020529-1.c: New test.