[cfe-dev] RFC: clang-tidy readability check to reduce clutter: unnecessary use of auto and ->

Fabio Fracassi via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 11 10:27:11 PST 2015


On 11/11/2015 06:22, Sean Silva via cfe-dev wrote:
> On Tue, Nov 10, 2015 at 9:29 AM, Richard via cfe-dev 
> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
>
>     The comments on this check seem to be asking for the *reverse* check:
>
>     switch everything to use auto
>
>
> Commenting from the sidelines, I see two things:
> 1. For more "traditional" (for lack of a better term) C++ codebases, 
> removing "unnecessary" uses of the -> syntax is probably a worthwhile 
> thing on the grounds of consistency (we would probably want something 
> like that in LLVM, not that we seem to have that problem in LLVM). 
> I.e., the policy is roughly "use the -> syntax only where strictly 
> necessary, but otherwise, for consistency, use the traditional syntax"
> 2. The `auto f() -> T` syntax opens up a new style altogether, and 
> green pasture projects might want to uniformly use that style.
>
> So I think your original post is basically about 1. and some 
> commenters have noted the existence of 2.
>
exactly.
> They're basically separate use cases and I don't think one should hold 
> up the other as far as writing clang-tidy checks.
+1



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151111/8d1ea57d/attachment.html>


More information about the cfe-dev mailing list