[PATCH] Proposal on how to fix temporary dtors.

Jordan Rose jordan_rose at apple.com
Wed May 28 08:23:18 PDT 2014


We should treat blocks the same as lambdas. How about GNU StmtExprs?

  if (check(OtherDtor()) &&
      ({ int x = 1; NoReturnDtor(); x + 1})) { ... }

To be fair, I'm not even sure how those are //supposed// to behave.

I'm not sure how your last-bind trick really works. In this code:

  First() && (Second() || Second()) && Third()

none of the temporaries can be aggregated, but I'm not sure how LastBoundTemporary accomplishes that, even given your explanation.

Can we start with the inefficient version that tests every temporary individually, and then consolidate afterwards?

================
Comment at: test/Analysis/temporaries.cpp:336-338
@@ +335,5 @@
+      ++y;
+      // Test that the CFG gets hooked up correctly when temporary destructors
+      // are handled after a statically known branch condition.
+      true ? (void)0 : (void)check(NoReturnDtor());
+    }
----------------
If this is the right test, then the comment was all I really wanted. There is of course a difference between this and the if-statement — the destructor here is in the same full-expression as the condition.

http://reviews.llvm.org/D3627






More information about the cfe-commits mailing list