[PATCH] D45405: [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name length to be replaced with 'auto'

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 06:07:10 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang-tidy/modernize/UseAutoCheck.cpp:290
+    : ClangTidyCheck(Name, Context), RemoveStars(Options.get("RemoveStars", 0)),
+      MinTypeNameLength(Options.get("MinTypeNameLength", 0)) {}
 
----------------
zinovy.nis wrote:
> lebedev.ri wrote:
> > alexfh wrote:
> > > Maybe make the default 5? Or does anyone really want to replace `int/long/char/bool/...` with `auto`?
> > That might be a bit surprising behavioral change..
> > At least it should be spelled out in the release notes.
> > (my 5 cent: defaulting to 0 would be best)
> Maybe we can somehow mention the current option value in a warning message?
Sure, can be done, but that will only be seen when it does fire, not when it suddenly stops firing...


https://reviews.llvm.org/D45405





More information about the cfe-commits mailing list