summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-485/+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
* Handle correctly containers that are data members in modernize-loop-convert.Angel Garcia Gomez2015-11-031-27/+0
| | | | | | | | | | | | | | | | Summary: I recently found that the variable naming wasn't working as expected with containers that are data members. The new index always received the name "Elem" (or equivalent) regardless of the container's name. The check was assuming that the container's declaration was a VarDecl, which cannot be converted to a FieldDecl (a data member), and then it could never retrieve its name. This also fixes some cases where the check failed to find the container at all (so it didn't do any fix) because of the same reason. Reviewers: klimek Subscribers: cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D14289 llvm-svn: 251943
* Switch check_clang_tidy to argparse and add a -resource-dir argument.Manuel Klimek2015-10-221-1/+1
| | | | | | | -resource-dir can be used to inject non-standard resource dirs via the lit site config. llvm-svn: 251021
* 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
* Add NamingStyle option to modernize-loop-convert.Angel Garcia Gomez2015-09-241-157/+157
| | | | | | | | | | | | Summary: Add an option to specify wich style must be followed when choosing the new index name. Reviewers: alexfh Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D13052 llvm-svn: 248517
* Another patch for modernize-loop-convert.Angel Garcia Gomez2015-09-111-1/+38
| | | | | | | | | | | | | | | | | | Summary: 1. Avoid converting loops that iterate over the size of a container and don't use its elements, as this would result in an unused-result warning. 2. Never capture the elements by value on lambdas, thus avoiding doing unnecessary copies and errors with non-copyable types. 3. The 'const auto &' instead of 'auto &' substitution on const containers now works on arrays and pseudoarrays as well. 4. The error about multiple replacements in the same macro call is now documented in the tests (not solved though). 5. Due to [1], I had to add a dummy usage of the range element (like "(void) *It;" or similars) on the tests that had empty loops. 6. I removed the braces from the CHECK comments. I think that there is no need for them, and they confuse vim. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D12734 llvm-svn: 247399
* Fix several corner cases for loop-convert check.Angel Garcia Gomez2015-09-011-192/+209
| | | | | | | | | | | | Summary: Reduced the amount of wrong conversions of this check. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D12530 llvm-svn: 246550
* [clang-tidy] Use a python script instead of a shell script to run clang-tidy ↵Alexander Kornienko2015-08-201-2/+1
| | | | | | | | | | | | | | | | | | | tests. Summary: Add check_clang_tidy.py script that is functionally identical to the check_clang_tidy.py, but should also be functional on windows. I've verified that the script works on linux. Would be nice if folks using Windows could test the patch before I break windows bots ;) Reviewers: chapuni, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12180 llvm-svn: 245583
* [clang-tidy] Add loop-convert check to clang-tidy.Alexander Kornienko2015-08-191-0/+459
Move LoopConvert from clang-modernize to modernize module in clang-tidy. http://reviews.llvm.org/D12076 Patch by Angel Garcia! llvm-svn: 245427
OpenPOWER on IntegriCloud