[cfe-dev] Should clang-tidys 'use-after-move' consider std::forward

Jonas Toth via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 14 12:26:05 PDT 2017


I wrote a testcase, that should cover `std::move`, `std::forward` and 
`static_cast<T&&>(t)` which should initiate a move as well, if i recall 
correctly. Only `std::move` is diagnosed.

Bugreport, Code + Output are here:

https://bugs.llvm.org/show_bug.cgi?id=34609




Am 14.09.2017 um 17:29 schrieb Martin Böhme:
> Interesting point -- I don't recall offhand, but I assume this isn't 
> currently handled and should be added.
>
> On 14 September 2017 at 13:53, Manuel Klimek <klimek at google.com 
> <mailto:klimek at google.com>> wrote:
>
>     +Martin
>
>
>     On Tue, Sep 12, 2017 at 5:19 PM Jonas Toth via cfe-dev
>     <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
>         Hello everybody,
>
>         when reading the code for `misc-use-after-move` in clang-tidy
>         i saw,
>         that the check explicitly matches "std::move", but not
>         "std::forward".
>         Since "std::forward" is a conditional move, shouldn't it be
>         matched as
>         well, or is it implicitly caught?
>
>         Regards, Jonas
>
>         _______________________________________________
>         cfe-dev mailing list
>         cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>         http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>         <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
>
>
>
>
> -- 
>
> Martin Böhme
>
> Software Engineer
>
> mboehme at google.com <mailto:mboehme at google.com>
>
>
> Google Germany GmbH
> Erika-Mann-Straße 33
> 80363 München
>
> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>
> Registergericht und -nummer: Hamburg, HRB 86891
>
> Sitz der Gesellschaft: Hamburg
>
>
> Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat 
> sind, leiten Sie diese bitte nicht weiter, informieren Sie den 
> Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank.
>
> This e-mail is confidential. If you are not the right addressee please 
> do not forward it, please inform the sender, and please erase this 
> e-mail including any attachments. Thanks.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170914/3e9405b1/attachment.html>


More information about the cfe-dev mailing list