<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 28, 2014, at 7:56 , Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 28, 2014 at 4:01 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On Mon, Jul 28, 2014 at 3:43 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Some more context:<div>It seems like we already need to do that when building the CFG: for the lifetime extended object we must not emit the destructor at the end of the full expression, which we currently do.</div>
</div></blockquote><div><br></div></div><div>And it looks like we're already trying to do that by handing BindToTemporary down. I'm investigating some more...</div></div></div></div></blockquote><div><br></div><div>
Found bug, separate patch sent (although right now I think it's also still wrong).</div><div>I think we need to fix how we handle lifetime extended temporaries before we can really do anything here - the main bug in lifetime extended temporary handling is in connecting the MaterializeTemporaryExpr to the right CXXBindTemporaryExpr (if it exists). Once that problem is solved, we can simple mark the CXXBindTemporary that is lifetime extended once we hit the MaterializeTempraryExpr in the static analyzer.</div></div></div></div></blockquote><br></div><div>I'd really like the CFG to be correct, not something that we have to reconstruct correctness for in the analyzer. We should be able to statically tell which temporary a MaterializeTemporaryExpr is going to bind to, right? Or rather, we should be able to tell whether or not a given CXXBindTemporaryExpr will be destroyed or bound if it is executed.</div><div><br></div><div>Jordan</div></body></html>