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

Reply via email to