<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Sep 30, 2016 at 11:12 PM Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's already an lvalue mutation test (see context above this diff).</blockquote><div><br></div><div>Doh, so there is!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Is rvalue mutation useful?  I imagine it already works, I just didn't think to test it because there wasn't an obvious use case<br class="gmail_msg"></blockquote><div><br></div><div>I think it is useful to ensure we don't get an accidental const in the types or otherwise mess this up when stashing storage somewhere. Even if with the current implementation we'd never write that bug, documenting that r-value ranges should be just as mutable as l-value seems worthwhile in unittests.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Fri, Sep 30, 2016 at 11:09 PM Chandler Carruth <<a href="mailto:chandlerc@gmail.com" class="gmail_msg" target="_blank">chandlerc@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chandlerc added a comment.<br class="gmail_msg">
<br class="gmail_msg">
Add a test showing mutation? Specifically that the range can be mutated even when a temporary is used, and that when an L-value is used the mutation mutates the underlying object rather than a copy (either of the element or the container).<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> STLExtrasTest.cpp:169<br class="gmail_msg">
> +  Copies = Moves = Destructors = 0;<br class="gmail_msg">
> +  // With an lvalue, it should not be destroyed even after the end of the scope.<br class="gmail_msg">
> +  // lvalue ranges need be neither copyable nor moveable.<br class="gmail_msg">
<br class="gmail_msg">
80-columns?<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D25124" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D25124</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div></div>