Can you add a test for the subobject case too, even though that doesn't work 
yet either?

    const LifetimeExtend &ref = Aggregate{ 0, 1 }.a;
    6;
    // expect ~Aggregate here rather than ~LifetimeExtend

Other than that, this seems like a fine incremental improvement.

================
Comment at: test/Analysis/cfg.cpp:421-429
@@ +420,11 @@
+  }
+  // CHECK: LifetimeExtend(5)
+  // CHECK-NEXT: : 5
+  // FIXME: We want to emit the destructors of the lifetime
+  // extended variables here.
+  // CHECK-NOT: ~LifetimeExtend()
+  {
+    AggregateRef a{LifetimeExtend(5), LifetimeExtend(5)};
+    5;
+  }
+  // FIXME: Add tests for lifetime extension via subobject
----------------
I did not realize this worked. Huh. That's going to be fun.

http://reviews.llvm.org/D4696



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to