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]

(C++) Patch to union restrictions


1998-10-28  Jason Merrill  <jason@yorick.cygnus.com>

	* class.c (finish_struct_1): Don't complain about non-copy
	assignment ops in union members.

Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.101
diff -c -p -r1.101 class.c
*** class.c	1998/10/28 01:53:43	1.101
--- class.c	1998/10/29 04:14:28
*************** finish_struct_1 (t, warn_anon)
*** 3703,3710 ****
  		    fie = "constructor";
  		  else if (TYPE_NEEDS_DESTRUCTOR (type))
  		    fie = "destructor";
! 		  else if (TYPE_HAS_REAL_ASSIGNMENT (type))
! 		    fie = "assignment operator";
  		  if (fie)
  		    cp_error_at ("member `%#D' with %s not allowed in union", x,
  				 fie);
--- 3703,3710 ----
  		    fie = "constructor";
  		  else if (TYPE_NEEDS_DESTRUCTOR (type))
  		    fie = "destructor";
! 		  else if (TYPE_HAS_COMPLEX_ASSIGN_REF (type))
! 		    fie = "copy assignment operator";
  		  if (fie)
  		    cp_error_at ("member `%#D' with %s not allowed in union", x,
  				 fie);


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