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.2 Regression] placement new does not change the dynamic type as it should



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-09-29 15:51 -------
Note here is a slightly better testcase as now we know that Foo and Bar are the
same size:
#include <new>
struct Foo { void *i; };
struct Bar { void *p; };
long foo(int n, int *t)
{
  Foo *f = new Foo;
  f->i = t;
  for (int i=0; i<n; ++i)
    {
      Bar *b = new (f) Bar;
      b->p = 0;
      f = new (f) Foo;
      f->i = t;
    }
  return f->i;
}


-- 


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]