summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-110/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* Run ClangTidy tests in all C++ language modesDmitri Gribenko2019-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: I inspected every test and did one of the following: - changed the test to run in all language modes, - added a comment explaining why the test is only applicable in a certain mode, - limited the test to language modes where it passes and added a FIXME to fix the checker or the test. Reviewers: alexfh, lebedev.ri Subscribers: nemanjai, kbarton, arphaman, jdoerfert, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62125 llvm-svn: 361131
* [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name ↵Zinovy Nis2018-04-101-1/+3
| | | | | | | | | | | | length to be replaced with 'auto' The threshold option is 'MinTypeNameLength' with default value '5'. With MinTypeNameLength == 5 'int'/'bool' and 'const int'/'const bool' will not be converted to 'auto', while 'unsigned' will be. Differential Revision: https://reviews.llvm.org/D45405 llvm-svn: 329730
* [clang-tidy] Enhance modernize-use-auto to castsMalcolm Parsons2016-10-311-0/+4
| | | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] modernize-use-auto: don't remove stars by defaultAlexander Kornienko2016-06-031-13/+14
| | | | | | | | | | | | | | | 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
* Add %check_clang_tidy and %clang_tidy_diff.Manuel Klimek2015-10-221-1/+1
| | | | | | | | | | With this, site specific lit configs can inject parameters into the test scripts if they need site specific parameters. Next up: enable check_clang_tidy to take a resource dir to enable non-standard locations for builtin includes. llvm-svn: 251010
* Prevent modernize-use-auto from emitting a warning when 'auto' was already ↵Angel Garcia Gomez2015-10-141-0/+5
| | | | | | | | | | | | | | 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
* Fix use-auto-check.Angel Garcia Gomez2015-09-021-0/+2
| | | | | | | | | | | | 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
* [clang-tidy] Migrate UseAuto from clang-modernize to clang-tidy.Angel Garcia Gomez2015-08-211-0/+96
http://reviews.llvm.org/D12231 llvm-svn: 245703
OpenPOWER on IntegriCloud