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]

C++ PATCH for c++/9623


reshape_init was trying to match initializer names to the appropriate
fields, but instead was setting 'field' to an IDENTIFIER_NODE, which
breaks.  We have never supported non-trivial named initializers in g++, so
the simplest fix for now is to just remove the offending code.

Test in g++.dg/ext/init1.C.  Tested i686-pc-linux-gnu.
Applied to trunk and 3.3.

2003-02-18  Jason Merrill  <jason@redhat.com>

	PR c++/9623
	* decl.c (reshape_init): Don't mess with initializer labels.

*** decl.c.~1~	Tue Feb 18 10:38:49 2003
--- decl.c	Tue Feb 18 11:45:47 2003
*************** reshape_init (tree type, tree *initp)
*** 7638,7643 ****
--- 7638,7644 ----
  	    {
  	      /* Loop through the initializable fields, gathering
  		 initializers.  */
+               /* FIXME support non-trivial labeled initializers.  */
  	      while (*initp && field)
  		{
  		  tree field_init;
*************** reshape_init (tree type, tree *initp)
*** 7652,7659 ****
  		     initializer for the first member of the union.  */
  		  if (TREE_CODE (type) == UNION_TYPE)
  		    break;
- 		  if (TREE_PURPOSE (field_init))
- 		    field = TREE_PURPOSE (field_init);
  		  field = next_initializable_field (TREE_CHAIN (field));
  		}
  	    }
--- 7653,7658 ----

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