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: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2007 15:43:23 -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 #130 from ian at airs dot com 2007-05-23 16:43 -------
In this example
void foo(int *p)
{
float *f = (float *)p;
new (p) float;
*f = 1.0;
}
the pointer is p. In fact the relevant pointer is always the argument to
placement new, and every pointer which PTA can associate with it.
We may simply have an impasse here. You have a set of rules which will change
the compiler to support placement new while giving better results for your
code. I believe that your change will penalize the code I used to work with.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286