<div class="gmail_quote">2010/11/3 Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div class="im">On Wed, Nov 3, 2010 at 2:19 PM, Marcin Swiderski <span dir="ltr"><<a href="mailto:marcin.sfider@gmail.com" target="_blank">marcin.sfider@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Author: sfider<br>
Date: Wed Nov  3 01:19:35 2010<br>
New Revision: 118158<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=118158&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=118158&view=rev</a><br>
Log:<br>
Added generating destructors for temporary objects. Two cases I know of, that are not handled properly:<br>
1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary,<br>
2. There will be no destructor for constant reference member bound to temporary at the exit from constructor.<br><br></blockquote></div><div><br>Hi Marcin,<br><br>Could you please provide two examples for these cases? <br>
</div>
</div>
</blockquote></div><br><div>Examples in attachment.</div><div><br></div><div>In test_impl_cond() you can see that when assigning expression result to regular variable both temporaries are destroyed and this is correct. But when assiging to constant reference, temporary in condition should be destroyed only when false branch is taken.</div>
<div><br></div><div>In TestConstRefMember constructor temporary is created and should be destroyed at the exit from constructor (after "int b").</div>