[PATCH] D20917: [clang-tidy] Add RemoveStars option to the modernize-use-auto check

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 09:22:23 PDT 2016


alexfh created this revision.
alexfh added reviewers: sbenza, aaron.ballman.
alexfh added a subscriber: cfe-commits.

Add RemoveStars option to the modernize-use-auto check. With the new option
turned on (by default) the check will change `MyType *t = new MyType;` to
`auto *t = new MyType;` instead of `auto t = new MyType;`, thus achieving more
consistency with the recommendations to use `auto *` for iterating over pointers
in range-based for loops:
http://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto

http://reviews.llvm.org/D20917

Files:
  clang-tidy/modernize/UseAutoCheck.cpp
  clang-tidy/modernize/UseAutoCheck.h
  docs/clang-tidy/checks/modernize-use-auto.rst
  test/clang-tidy/modernize-use-auto-new-remove-stars.cpp
  test/clang-tidy/modernize-use-auto-new.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20917.59399.patch
Type: text/x-patch
Size: 10721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160602/b8f5e7c8/attachment-0001.bin>


More information about the cfe-commits mailing list