<div dir="auto">Hey Mario,<div dir="auto"><br></div><div dir="auto">I logged a bug for this a long time ago: <a href="https://bugs.llvm.org/show_bug.cgi?id=25319">https://bugs.llvm.org/show_bug.cgi?id=25319</a></div><div dir="auto">From what I can see, this still ain't solved.</div><div dir="auto"><br></div><div dir="auto">It makes sense to register you onto that one.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 30, 2020, 19:02 Mario Charest via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@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">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>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank" rel="noreferrer">cfe-users@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div>