This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) Patch to union restrictions
- To: egcs-patches at cygnus dot com
- Subject: (C++) Patch to union restrictions
- From: Jason Merrill <jason at cygnus dot com>
- Date: Wed, 28 Oct 1998 20:21:38 -0800
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);