This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Remove obsolete code concerning unnamed unions
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Nov 2005 13:47:32 +0100 (CET)
- Subject: [patch] Remove obsolete code concerning unnamed unions
The following check removes some obsolete code concerning unnamed unions.
See discussion in PR15938, comment #8 and later.
Bootstrapped and regtested on i686-pc-linux-gnu.
Ok for mainline?
Regards,
Volker
2005-11-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* typeck2.c (process_init_constructor_union): Remove check for
unnamed union members.
===================================================================
--- gcc/gcc/cp/typeck2.c 1 Aug 2005 04:02:26 -0000 1.192
+++ gcc/gcc/cp/typeck2.c 12 Oct 2005 16:49:30 -0000
@@ -995,12 +995,7 @@ process_init_constructor_union (tree typ
tree field = TYPE_FIELDS (type);
while (field && (!DECL_NAME (field) || TREE_CODE (field) != FIELD_DECL))
field = TREE_CHAIN (field);
- if (!field)
- {
- error ("union %qT with no named members cannot be initialized",
- type);
- ce->value = error_mark_node;
- }
+ gcc_assert (field);
ce->index = field;
}
===================================================================