<div dir="ltr">On Mon, Jun 10, 2013 at 1:29 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  You're likely to need a Sema change to ensure that a destructor for the parameter type is implicitly declared (if needed) in the TU containing the caller (otherwise IR generation will probably crash or assert when trying to emit a call to it).<br>
</blockquote><div><br></div><div style>I think I solved this with a forthcoming patch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  You'll presumably also need either a Sema change or a CodeGen change to ensure that a definition of the destructor ends up in the program -- either mark the dtor as used in the TU containing the callee (which is likely to match MSVC but is non-conforming), or demote it from linkonce_odr to weak_odr in the TU containing the call (which is conforming but may hinder inlining etc).<br>
</blockquote><div><br></div><div style>What's wrong with marking the dtor as used?  You need a full class definition to take a class by value, right?</div></div></div></div>