NoQ added a comment. Herald added a subscriber: Szelethus. In https://reviews.llvm.org/D49811#1175927, @NoQ wrote:
> Devin has recently pointed out that we might have as well reordered CFG > elements to have return statement kick in after automatic destructors, so > that callbacks were called in a different order. I don't see any problems > with that solution, but let's stick to the current solution for now, because > who knows. In https://bugs.llvm.org/show_bug.cgi?id=11645#c9 Ted wrote: > If we treat an occurrence of "return" in the CFG is meaning "bind an > expression result for the return value" and not as a transfer of control then > it is is fine for the destructors to appear after the "return". From this > view, the transfer back to the caller is when we hit the Exit block. Another possible solution is to check in the destructor if the newly dangling pointer is already bound to the return statement. Repository: rC Clang https://reviews.llvm.org/D49811 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits