<div dir="ltr">Is there a more canonical way to detect that the function is std::move instead of another move function?  This would fail to recognize std::__1::move.<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 1:49 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">getQualifiedNameAsString is pretty expensive. Moreover, won't this fail if libc++ puts std::move in std::__1::move?<br>

<span class="HOEnZb"><font color="#888888"><br>
Jordan<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Dec 16, 2013, at 13:41, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>
<br>
> Author: rtrieu<br>
> Date: Mon Dec 16 15:41:30 2013<br>
> New Revision: 197428<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=197428&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=197428&view=rev</a><br>
> Log:<br>
> Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move<br>
><br>
> Modified:<br>
>    cfe/trunk/lib/Analysis/Consumed.cpp<br>
>    cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp<br>
><br>
> Modified: cfe/trunk/lib/Analysis/Consumed.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=197428&r1=197427&r2=197428&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=197428&r1=197427&r2=197428&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/Analysis/Consumed.cpp (original)<br>
> +++ cfe/trunk/lib/Analysis/Consumed.cpp Mon Dec 16 15:41:30 2013<br>
> @@ -611,7 +611,8 @@ void ConsumedStmtVisitor::VisitCallExpr(<br>
><br>
>     // Special case for the std::move function.<br>
>     // TODO: Make this more specific. (Deferred)<br>
> -    if (FunDecl->getNameAsString() == "move") {<br>
> +    if (FunDecl->getQualifiedNameAsString() == "std::move" &&<br>
> +        Call->getNumArgs() == 1) {<br>
>       forwardInfo(Call->getArg(0), Call);<br>
>       return;<br>
>     }<br>
><br>
> Modified: cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp?rev=197428&r1=197427&r2=197428&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp?rev=197428&r1=197427&r2=197428&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp (original)<br>
> +++ cfe/trunk/test/SemaCXX/warn-consumed-analysis.cpp Mon Dec 16 15:41:30 2013<br>
> @@ -793,3 +793,22 @@ void testTemporariesAndOperators2() {<br>
><br>
> } // end namespace InitializerAssertionFailTest<br>
><br>
> +<br>
> +namespace std {<br>
> +  void move();<br>
> +  template<class T><br>
> +  void move(T&&);<br>
> +}<br>
> +<br>
> +namespace PR18260 {<br>
> +  class X {<br>
> +    public:<br>
> +      void move();<br>
> +  } x;<br>
> +<br>
> +  void test() {<br>
> +    x.move();<br>
> +    std::move();<br>
> +    std::move(x);<br>
> +  }<br>
> +} // end namespace PR18260<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br></div></div>