<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 2, 2017 at 9:37 AM, Zachary Turner via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">It's possible I'm missing something, but I can't reproduce this:<div><br></div><div><div> std::vector<int> A = { 4, 15, 42 , 16, 8, 23};</div><div> ArrayRef<int> B(A);</div><div> std::sort(B.begin(), B.end());</div></div><div><br></div><div>fails to compile for me.</div><div><br></div></div></blockquote><div><br></div><div>As later mentioned, it was transient and appears to have only affected some version :)</div><div>Because of that, i stopped looking into it after tracking it down to what appears to be a hilarious miscompile of clang.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>ArrayRef<T>::iterator is specified as `const T *`, so I'm not seeing how this could happen?</div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 1, 2017 at 4:01 PM Chris Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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"><div style="word-wrap:break-word">+1, totally a bug. That’s the domain of MutableArrayRef.</div><div style="word-wrap:break-word"><div><br></div><div>-Chris</div></div><div style="word-wrap:break-word"><div><br><div><blockquote type="cite"><div>On Oct 1, 2017, at 6:52 AM, David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_3635625110102477266m_-2809850402796043072Apple-interchange-newline"><div><div dir="ltr">+1 seems like a bug<br></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 1, 2017 at 12:35 AM Reid Kleckner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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"><div dir="auto">It wraps a constant T* and a size_t, so I'm surprised std::sort works. It shouldn't.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sep 30, 2017 5:22 PM, "Daniel Berlin via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="m_3635625110102477266m_-2809850402796043072m_7643836357708728490quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It seems like ArrayRefs are supposed to be immutable (<div>However, as far as i can tell, the iterators are defined wrong to make this true.</div><div><br></div><div>While </div><div>ArrayRef<int> Foo(Something);</div><div>Foo[0] = 5;</div><div><br></div><div>will give a compile time error.</div><div><br></div><div>something like:<br><br></div><div>ArrayRef<int> Foo(Something);</div><div>std::sort(Foo.begin(), Foo.end());</div><div><br></div><div>Will work fine.</div><div><br></div><div>Is this expected?</div><div><br></div><div>(FWIW: I expected this to only work with a MutableArrayRef)</div><div><br></div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>