<div dir="ltr">Hello,<div><br></div><div>First post, be gentle ;-)</div><div><br></div><div>I'm trying to find a clean solution to an error message that clang-tidy is giving, tried with 10 and 11)</div><div><br></div><div>This is the code:</div><div><br></div><div>struct Foo<br>{<br>    Foo(const std::string &value) : m_name(value) {} <br>    Foo(std::string &&value) : m_name(std::move(value)) {}<br>    std::string m_name;<br>};<br></div><div><br></div><div>The message is :</div><div><br>warning: pass by value and use std::move [modernize-pass-by-value]<br>    Foo(const std::string &value) : m_name(value) {}<br>        ^~~~~~~~~~~~~~~~~~~<br>        std::string                        std::move( )</div><div><br></div><div>I understand the logic behind the warning.  Unfortunately the solution cannot be apply because of the move constructor. Won't compile.  One might argue the move constructor could be remove. But I did not make that post to get into that.  What I would like to know if it would make sense to make clang-tidy smarter about this and not generate that message if a move constructor is present ?  </div><div><br></div><div>Regards,</div><div><br></div><div>- Mario</div></div>