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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That last testcase isn't very good for the testsuite, because 0 is pretty
common value on the stack, so even without the store the chances that it will
be already zero are high.

42 is less likely...

// PR c++/104031
// { dg-do run { target c++14 } }
// { dg-options "-O2" }

struct A {
  A () {}
  ~A () {}
};
struct B {
  A a;
  int b = 0;
};
struct C
{
  [[gnu::noipa]]
  C (B x) { if (x.b != 42) __builtin_abort (); }
};
static C c ({ .a = A{}, .b = 42 });

int
main ()
{
}

Reply via email to