<div dir="ltr">Fair enough - no worries. <br><br>Another option would be just to:<br><br>push_back(make_pair(make_unique(Tuple), MDTuple::getTemporary(...)))<br><br>That should just move the pair into the container, which should do piecewise move. Depends whether you want to make_unique expicitly or not, I guess? I sort of favor it, personally (so it's clear that ownership is being taken, rather than not knowing without looking at the original container type declaration, etc)</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 6:17 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
> On 2016-Apr-25, at 10:37, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Sat, Apr 23, 2016 at 2:23 PM, Duncan P. N. Exon Smith via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: dexonsmith<br>
> Date: Sat Apr 23 16:23:41 2016<br>
> New Revision: 267298<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267298&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267298&view=rev</a><br>
> Log:<br>
> BitcodeReader: Avoid non-moving std::piecewise_construct from r267296<br>
><br>
> Not exactly sure why the host tries to use a copy constructor here, but<br>
> it's easy enough to work around it.<br>
><br>
> <a href="http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6227" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6227</a><br>
><br>
> Modified:<br>
> llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
><br>
> Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=267298&r1=267297&r2=267298&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=267298&r1=267297&r2=267298&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)<br>
> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Sat Apr 23 16:23:41 2016<br>
> @@ -1215,9 +1215,9 @@ Metadata *BitcodeReaderMetadataList::upg<br>
><br>
> // Create and return a placeholder to use for now. Eventually<br>
> // resolveTypeRefArrays() will be resolve this forward reference.<br>
> - OldTypeRefs.Arrays.emplace_back(<br>
> - std::piecewise_construct, std::make_tuple(Tuple),<br>
> - std::make_tuple(MDTuple::getTemporary(Context, None)));<br>
><br>
> make_tuple copies the contents, like make_pair<br>
><br>
> Typically what you want to use with piecewise_construct is std::forward_as_tuple instead. This creates a tuple of references (of the right kind - rvalue or lvalue, etc). Try that?<br>
><br>
<br>
</div></div>Somehow I missed this email until now :(. That looks like what my<br>
problem was -- I'll try to come back to this early next week (don't have<br>
the opportunity just this minute, but wanted to acknowledge I'd received<br>
the review).<br>
<div class="HOEnZb"><div class="h5"><br>
> + OldTypeRefs.Arrays.emplace_back();<br>
> + OldTypeRefs.Arrays.back().first.reset(Tuple);<br>
> + OldTypeRefs.Arrays.back().second = MDTuple::getTemporary(Context, None);<br>
> return OldTypeRefs.Arrays.back().second.get();<br>
> }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br></div>