https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84405

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Another testcase that could in theory affect vec_default_construct is:
extern "C" void abort ();
typedef __typeof (sizeof (0)) size_t;
inline void *operator new (size_t, void * p) { return p; }
extern "C" void *memset (void *, int, size_t);
template<typename T, typename U>
struct A { T t; U u; };
struct B { B (); ~B (); int b; };
B::B () : b (9) {}
B::~B () {}

template <typename T>
void foo (char *p) { new (p) T (); }

int
main ()
{
  int a;
  struct S
  {
    A<int *, B> b;
    char c[sizeof (A<int *, B>)];
  } s;
  A<int *, B> *p = (A<int *, B> *) &s.c;
  memset (s.c, 0x55, sizeof (s.c));
  foo <A<int *, B> > (s.c);
  if (p->t)
    abort ();
}

and that was fixed in PR11309 / r138355 only in 4.4.
And Jon mentions another one value initialization related - PR30111.

Reply via email to