<div dir="ltr">I'll look into the pessimizing move warning, then after that, the deprecated copy warning.<br><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 16, 2018 at 10:41 AM Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</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">Yes, we should produce this warning in C++11 mode too. (I could be misrecalling, but I think the rationale for the current behaviour is based on historical GCC behaviour.)</div><br><div class="gmail_quote"><div dir="ltr">On Sun, 16 Sep 2018, 10:04 David Blaikie via cfe-dev, <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-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="ltr">Fair point made on that thread - that this is a DR, so technically the std::move is pessimizing even in C++11 mode. Richard: Any thoughts on generalizing the warning to cover these cases even in C++11 mode?<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 15, 2018 at 2:37 AM Dávid Bolvanský <<a href="mailto:david.bolvansky@gmail.com" rel="noreferrer" target="_blank">david.bolvansky@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">There is a new discussion related to -Wredundant-move warning on GCC bugzilla.<div><br></div><div><a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87300" rel="noreferrer" target="_blank">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87300</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">pi 14. 9. 2018 o 9:53 David Blaikie <<a href="mailto:dblaikie@gmail.com" rel="noreferrer" target="_blank">dblaikie@gmail.com</a>> napísal(a):<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 14, 2018 at 12:48 AM Stephan Bergmann <<a href="mailto:sbergman@redhat.com" rel="noreferrer" target="_blank">sbergman@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 13/09/2018 18:22, David Blaikie via llvm-dev wrote:<br>
> On Thu, Sep 13, 2018 at 12:13 AM Dávid Bolvanský via llvm-dev <br>
> <<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a>>> wrote:<br>
>     /home/davidbolvansky/trunk/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp:79:40: <br>
>       required from here<br>
>     /home/davidbolvansky/trunk/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h:314:29:<br>
>     warning: redundant move in return statement [-Wredundant-move]<br>
>     314 |         return std::move(Err);<br>
<br>
Note that the move (into the implicit JITSymbol(Error) ctor) is only <br>
redundant if the compiler implements a fix for <br>
<<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579" rel="noreferrer noreferrer" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579</a>> <br>
"Return by converting move constructor".  (But not sure whether the LLVM <br>
compiler baselines imply that, anyway. </blockquote><div><br>Looks like that was accepted for C++14, not 11. So I don't believe it's valid to remove the std::move in C++11 code. (& I believe Clang's warning correctly diagnoses this only in the right language versions) - so we probably want to disable the buggy GCC warning here, then.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> In LibreOffice it forced me to <br>
introduce ugly #ifs, to not have to disable that warning outright, <br>
<<a href="https://cgit.freedesktop.org/libreoffice/core/commit/?id=dc06c8f4989fc28d0c31ebd333e53dfe0e0f5f66" rel="noreferrer noreferrer" target="_blank">https://cgit.freedesktop.org/libreoffice/core/commit/?id=dc06c8f4989fc28d0c31ebd333e53dfe0e0f5f66</a>> <br>
"-Werror=redundant-move (GCC 9), take two".)<br>
</blockquote></div></div>
</blockquote></div></blockquote></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
</blockquote></div></div>