I think modernize-use-auto is good for the problem we aren't discussion and maybe a problem we don't have (using auto not enough and wanting to migrate code to use it more). A tool that gives a "hey, maybe your use of auto here is more for writability than readability" would be a different thing, and probably a bit challenging to tune it's false positive rate to not be annoying etc.<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 6, 2018, 2:13 AM Piotr Padlewski via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I agree with George here, the current implementation of <a href="http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html" target="_blank">modernize-use-auto</a> uses pretty much the same rules as described in our coding standards which we all agree on, mainly:<div>- iterators (begin, end)</div><div>- cast expressions</div><div>- new expression</div><div><br></div><div>Ofc there are more cases where type is obvious and where we would like to use auto, but automating the part that modernize-use-auto can do is enough to cover most of the cases.</div><div><br></div><div>Cheers</div><div></div></div><div dir="ltr"><div>Piotr<br><div><div><br><div class="gmail_quote"><div dir="ltr">czw., 6 gru 2018 o 08:46 George Burgess IV via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So the problem becomes one of seeing if people will accept `auto` rules that don't require substantial amounts of thought.</div><div><br></div><div>Personally, I see this like our use of clang-format. It might not use my favorite color of paint, but it's uniform, automatic, and it lets me entirely forget about tons of style nits, so I love it to death. Hence, if we need to start with "no auto, except in this small set of trivially OK and machine-verifiable cases, which we'll consider expanding this as need arises," to get to that, I'd be all for it.</div><div><br></div><div>I realize that many devs probably strongly disagree with me here, but that's my 2c.</div><div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 9:26 PM Chris Lattner <<a href="mailto:clattner@nondot.org" target="_blank">clattner@nondot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Dec 4, 2018, at 10:59 AM, George Burgess IV <<a href="mailto:george.burgess.iv@gmail.com" target="_blank">george.burgess.iv@gmail.com</a>> wrote:<br>
> <br>
> > 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<br>
> <br>
> 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/?<br>
<br>
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.<br>
<br>
-Chris<br>
<br>
<br>
</blockquote></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>