summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-12/+11
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Enhance modernize-use-auto to castsMalcolm Parsons2016-10-311-24/+53
| | | | | | | | | | | | | | | | | | | | Summary: Extend modernize-use-auto to cases when a variable is assigned with a cast. e.g. Type *Ptr1 = dynamic_cast<Type*>(Ptr2); http://llvm.org/PR25499 Reviewers: angelgarcia, aaron.ballman, klimek, Prazek, alexfh Subscribers: Prazek, Eugene.Zelenko, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D25316 llvm-svn: 285579
* Fix clang-tidy patterns to adapt to newly added ExprWithCleanups nodes.Tim Shen2016-06-211-0/+2
| | | | | | | | | | | | Summary: This is a fix for the new ExprWithCleanups introduced by clang's temporary variable lifetime marks change. Reviewers: bkramer, sbenza, angelgarcia, alexth Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D21243 llvm-svn: 273310
* [clang-tidy] modernize-use-auto: don't remove stars by defaultAlexander Kornienko2016-06-031-19/+32
| | | | | | | | | | | | | | | Summary: By default, modernize-use-auto check will retain stars when replacing an explicit type with `auto`: `MyType *t = new MyType;` will be changed to `auto *t = new MyType;`, thus resulting in 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 The new `RemoveStars` option allows to revert to the old behavior: with the new option turned on the check will change `MyType *t = new MyType;` to `auto t = new MyType;`. Reviewers: aaron.ballman, sbenza Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D20917 llvm-svn: 271739
* Make a bunch of static arrays const.Craig Topper2015-10-181-12/+14
| | | | llvm-svn: 250641
* Prevent modernize-use-auto from emitting a warning when 'auto' was already ↵Angel Garcia Gomez2015-10-141-0/+3
| | | | | | | | | | | | | | being used. Summary: This fixes https://llvm.org/bugs/show_bug.cgi?id=25082 . Reviewers: bkramer, klimek Subscribers: cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13504 llvm-svn: 250284
* Refactors AST matching code to use the new AST matcher names. This patch ↵Aaron Ballman2015-09-171-14/+15
| | | | | | correlates to r247885 which performs the AST matcher rename in Clang. llvm-svn: 247886
* Fix use-auto-check.Angel Garcia Gomez2015-09-021-1/+1
| | | | | | | | | | | | Summary: Fix a bug where use-auto check would crash when the definition of a type is in the same statement than its instantiation with new. Reviewers: alexfh Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D12551 llvm-svn: 246638
* Disable several more clang-tidy modernize checkers when not compiling in C++ ↵Aaron Ballman2015-08-281-2/+6
| | | | | | mode. Loop conversion would make recommendations for C code, so added a test to ensure that does not happen. The pass by value, use auto and replace auto_ptr checkers would not make recommendations for C code, and are disabled for performance reasons, but do not require an extra test. llvm-svn: 246310
* [clang-tidy] Migrate UseAuto from clang-modernize to clang-tidy.Angel Garcia Gomez2015-08-211-0/+368
http://reviews.llvm.org/D12231 llvm-svn: 245703
OpenPOWER on IntegriCloud