<div dir="ltr">Hi Jordan,<div><br></div><div>I made some progress on inlining temporary destructors. My main problem currently is that somehow the initializer values in my constructor get lost if I don't also reference 'this' via some other way.</div>
<div><br></div><div>An examples shows that best. Consider:</div><div>struct A {</div><div>  A(int* y) : z(y) {}</div><div>  ~A() { *z = 23; }</div><div>  int *z;</div><div>};</div><div>void f() {</div><div>  int x = 0;</div>
<div>  {(A(&x));}</div><div>}</div><div><br></div><div>This leads to a "Dereference of undefined pointer value" warning on *z = 23.</div><div>Funnily enough this warning goes away (and all values get correctly propagated) if change the constructor to be:</div>
<div>A(int* y) : z(y) { (void)this; }</div><div><br></div><div>Obviously this also works fine if I use a local variable instead of a temporary.</div><div><br></div><div>Any ideas what might be going wrong here would be greatly appreciated.</div>
<div>Thanks!</div><div>/Manuel</div></div>