<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 29, 2015 at 2:57 AM, Sebastian Redl <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at" target="_blank">sebastian.redl@getdesigned.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
On 28.07.2015 21:06, Richard Trieu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
Author: rtrieu<br>
Date: Tue Jul 28 14:06:16 2015<br>
New Revision: 243463<br>
<br></span>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D243463-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=ulgdL6ks8e0MZ2O1kgMnDkgdPulJuTuNBazSH01sXiE&s=qlkOTrrrfZ2g4ekyy8HKtI4PcvVs2S_T_6cbSBj2NLQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=243463&view=rev</a><span><br>
Log:<br>
Do not give a -Wredundant-move warning when removing the move will result in an<br>
error.<br>
<br>
If the object being moved has a move constructor and a deleted copy constructor,<br>
std::move is required, otherwise Clang will give a deleted constructor error.<br>
<br>
</span></blockquote>
Is that actually correct behavior by Clang? GCC 5.2 compiles the following without problems:<br>
<br>
struct A {<br>
A() {}<br>
A(A&&) {}<br>
};<br>
<br>
struct B {<br>
B(A) {}<br>
};<br>
<br>
B fn(A a) {<br>
return a;<br>
}<br>
<br>
int main() {<br>
fn(A());<br>
}<br>
<br>
Sebastian<br><br></blockquote><div>I believe that older versions of GCC will give an error on this code as well. In discussions with Richard Smith, he mentioned that there is a DR for this and that Clang should implement it. Until it is implemented, this warning should not suggest a fix that won't compile.</div></div></div></div>