This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- From: "gdr at cs dot tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2007 09:47:16 -0000
- Subject: [Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- References: <bug-29286-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #158 from gdr at cs dot tamu dot edu 2007-05-24 10:47 -------
Subject: Re: [4.0/4.1/4.2/4.3 Regression] placement new does not change the
dynamic type as it should
"rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org> writes:
[...]
| > Now, if I understand your argument below correctly, you are saying
| > that even if we fixed the union rules for C++, we may still be facing
| > the same problem because assignment to POD objects does not just mean
| > that the object was there before, but that we are actually starting a
| > new one. Do I understand your argument correctly?
|
| Yes.
Then, I'm not sure I agree with that. I'll raise it as part of the
union problem.
| For non-PODs I'm not sure if it is allowed to start object
| lifetime via assignment rather than only by placement new.
Assignment for non-POD is equivalent to calling a member function for
an object, which means that the object already existed. So, no you
cannot start lifetime for object of non-POD type by assignment.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286