This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should



------- 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


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