[PATCH] D15121: A new clang-tidy module to find calls to `std::swap`, and change them to use ADL

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 3 08:15:54 PST 2015


On Thu, Dec 3, 2015 at 8:08 AM, Marshall Clow via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> mclow.lists added a comment.
>
> I ran this on LLVM + clang, and it changed calls in 61 files.  The changed
> LLVM codebase compiled successfully, and passed all the tests.
>
> Re: @dblaikie's comment, I'd rather call such a beast `llvm::swap`,


Strikes me as a little subtle, but I don't find it fundamentally
objectionable.


> and it would have to go into a header file that everyone already includes.
>

Fair - difficult to do fixits that add includes. And while we do have a few
headers that nearly everyone includes, they're probably not /everywhere/
and it may not be appropriate to put this utility in them anyway. Perhaps
we can just, as a rule, ignore the general fixit hint and fix it 'our' way?

(or could we (do we?) have a lower bar for clang-tidy fixit hints that
would allow us to just fixit to this function and let the user realize they
need to add a missing include?)


>
>
> http://reviews.llvm.org/D15121
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151203/b02080d3/attachment.html>


More information about the cfe-commits mailing list