r197428 - Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move

Richard Trieu rtrieu at google.com
Mon Dec 16 16:48:24 PST 2013


On Mon, Dec 16, 2013 at 2:20 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> On Mon, Dec 16, 2013 at 2:07 PM, Richard Trieu <rtrieu at google.com> wrote:
> > 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.
>
> Sema::getStdNamespace() could be probably useful in this.  Should it
> be safe to assume that if the function is std::move if it is named
> 'move', and it comes from any namespace under ::std?
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>

I checked in r197445 which does a namespace walk to find if the highest
namespace is "std".  This will accept both std::move and std::__1::move.

I didn't see a Sema object available to use getStdNamespace.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131216/f2a9def3/attachment.html>


More information about the cfe-commits mailing list