This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18975] Copying objects with mutable non-static data members
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2004 13:44:17 -0000
- Subject: [Bug c++/18975] Copying objects with mutable non-static data members
- References: <20041214071926.18975.wolfgang.roehrl@de.gi-de.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From nathan at gcc dot gnu dot org 2004-12-17 13:44 -------
I now think the code is ok, and both compilers are incorrect to reject any of
the versions.
The versions that do not contain user defined
XYZ (const XYZ& src)
XYZ& operator= (const XYZ& src)
functions are the problematic ones. In those cases, the compiler should
synthesize suitable definitions of those functions. It correctly determines
the CV qualifier of the SRC argument, but fails to generate the correct
body. That body should be identical to the body supplied in the user-defined
version. Namely copy construction or copy assignment of each member in turn.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |nathan at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18975