<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 30, 2014 at 4:37 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you add a test for the subobject case too, even though that doesn't work yet either?<br>
<br>
    const LifetimeExtend &ref = Aggregate{ 0, 1 }.a;<br>
    6;<br>
    // expect ~Aggregate here rather than ~LifetimeExtend<br></blockquote><div><br></div><div>Unfortunately, I can't add the test - the problem is that this currently crashes - my other patch will fix this (with tests :)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than that, this seems like a fine incremental improvement.<br>
<br>
================<br>
Comment at: test/Analysis/cfg.cpp:421-429<br>
@@ +420,11 @@<br>
+  }<br>
+  // CHECK: LifetimeExtend(5)<br>
+  // CHECK-NEXT: : 5<br>
+  // FIXME: We want to emit the destructors of the lifetime<br>
+  // extended variables here.<br>
+  // CHECK-NOT: ~LifetimeExtend()<br>
+  {<br>
+    AggregateRef a{LifetimeExtend(5), LifetimeExtend(5)};<br>
+    5;<br>
+  }<br>
+  // FIXME: Add tests for lifetime extension via subobject<br>
----------------<br>
I did not realize this worked. Huh. That's going to be fun.<br></blockquote><div><br></div><div>My other patch also addresses this problem (it's not actually that much of a problem, we just can't use the VarDecl as anchor any more).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="http://reviews.llvm.org/D4696" target="_blank">http://reviews.llvm.org/D4696</a><br>
<br>
<br>
</blockquote></div><br></div></div>