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]

Re: C++: Internal compiler error 981117.


> You're right.  The bug is that we're assuming that we don't need to deal
> with that field if we have base classes.  Removing the 'else' just above
> the assert should do the trick.

It does. Here is an updated patch.

1999-03-23  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
	classes.

Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.135
diff -c -p -r1.135 class.c
*** class.c	1999/03/09 23:02:30	1.135
--- class.c	1999/03/23 20:34:05
*************** finish_struct_1 (t, warn_anon)
*** 3986,3992 ****
    if (n_baseclasses)
      /* layout_basetypes will remove the base subobject fields.  */
      max_has_virtual = layout_basetypes (t, max_has_virtual);
!   else if (empty)
      TYPE_FIELDS (t) = fields;
  
    my_friendly_assert (TYPE_FIELDS (t) == fields, 981117);
--- 3986,3992 ----
    if (n_baseclasses)
      /* layout_basetypes will remove the base subobject fields.  */
      max_has_virtual = layout_basetypes (t, max_has_virtual);
!   if (empty)
      TYPE_FIELDS (t) = fields;
  
    my_friendly_assert (TYPE_FIELDS (t) == fields, 981117);


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