This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
     }
 
===================================================================



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]