[llvm-dev] [cfe-dev] RFC: Modernizing our use of auto
David Blaikie via llvm-dev
llvm-dev at lists.llvm.org
Thu Dec 6 11:37:38 PST 2018
On Wed, Dec 5, 2018, 9:27 PM Chris Lattner via cfe-dev <
cfe-dev at lists.llvm.org wrote:
>
>
> > On Dec 4, 2018, at 10:59 AM, George Burgess IV <
> george.burgess.iv at gmail.com> wrote:
> >
> > > I think people are too eager to use `auto` because it is easy to write
> but it makes the types substantially harder for the reader to understand
> >
> > I'm probably the Nth person to ask this, but what keeps us from
> promoting the use of a clang-tidy-powered tool that basically emits fixits
> of s/auto/actual_type/?
>
For me: I still don't know how to integrate clang-tidy into my development
workflow. I'm open to pointers to documentation/etc.
Because the tool would need to apply judgement to when this makes sense.
> If we can’t write an algorithm in coding standards.html to be prescriptive
> about when to use auto, then I don’t think we can automate this.
>
Yeah, I don't think we can automate it entirely, but at least it might
lower the writing cost to make it easier for folks favoring auto for
writability where community standards would prefer the named type. Nice
thing about clang-tidy etc is if integrated well, it should only flag on
code in the current diff, and only as a suppressible suggestion not a hard
requirement.
I think if folks want to work on that, it'd be appreciated, but I don't
think it changes the discussion around what style we want.
> -Chris
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181206/d1b52f47/attachment.html>
More information about the llvm-dev
mailing list