summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-278/+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/+2
| | | | | | | | | | | | | | | | | | | | | | | 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] Fix http://llvm.org/PR38055Alexander Kornienko2018-07-041-0/+15
| | | | llvm-svn: 336283
* [clang-tidy] misc-unused-parameters - retain old behavior under StrictModeAlexander Kornienko2018-06-281-1/+37
| | | | | | | | | | | | | | Summary: This addresses https://bugs.llvm.org/show_bug.cgi?id=37467. Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman Reviewed By: lebedev.ri, aaron.ballman Subscribers: aaron.ballman, lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D46951 llvm-svn: 335863
* Do not warn on unused parameters for functions with empty bodies.Manuel Klimek2018-05-091-44/+47
| | | | | | If a function has an empty body, all parameters are trivially unused. llvm-svn: 331875
* [clang-tidy] Fixed misc-unused-parameters omitting parameters square bracketsAlexander Kornienko2017-09-151-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Bug: https://bugs.llvm.org/show_bug.cgi?id=34449 **Problem:** Clang-tidy check misc-unused-parameters comments out parameter name omitting following characters (e.g. square brackets) what results in its complete removal. Compilation errors might occur after clang-tidy fix as well. **Patch description:** Changed removal range. The range should end after parameter name, not after whole parameter declarator (which might be followed by e.g. square brackets). Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Patch by Pawel Maciocha! Differential Revision: https://reviews.llvm.org/D37846 llvm-svn: 313355
* [clang-tidy] fixed misc-unused-parameters omitting parameters default valueAlexander Kornienko2017-09-131-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Bug: https://bugs.llvm.org/show_bug.cgi?id=34450 **Problem:** Clang-tidy check misc-unused-parameters omits parameter default value what results in its complete removal. Compilation errors might occur after clang-tidy fix. **Patch description:** Changed removal range. The range should end after parameter declarator, not after whole parameter declaration (which might contain a default value). Reviewers: alexfh, xazax.hun Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Tags: #clang-tools-extra Patch by Pawel Maciocha! Differential Revision: https://reviews.llvm.org/D37566 llvm-svn: 313150
* [clang-tidy] Don't delete unused parameter in class override method in ↵Haojian Wu2016-04-011-0/+10
| | | | | | | | | | | | | | anonymous namespace. Summary: Fixes PR26740. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17926 llvm-svn: 265117
* Fix bug in suggested fix that truncated variable names to 1 character.Samuel Benzaquen2015-11-111-2/+28
| | | | | | | | | | | | | | Summary: Fix bug in suggested fix that truncated variable names to 1 character. Also, rework the suggested fix to try to remove unnecessary whitespace. Reviewers: alexfh, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13899 llvm-svn: 252773
* 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
* misc-unused-parameter: Ignore lambda static invokers.Daniel Jasper2015-09-221-1/+4
| | | | llvm-svn: 248252
* [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
* Move an extra switch to ↵NAKAMURA Takumi2015-07-281-1/+1
| | | | | | | | clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp from check_clang_tidy.sh. It also rolls back r242984 and r242985. llvm-svn: 243491
* misc-unused-parameters: Only remove parameters in the main source file.Daniel Jasper2015-07-281-1/+7
| | | | | | | In headers, they might always be pulled in to different TUs, even if they are declared static or nested in an unnamed namespace. llvm-svn: 243414
* misc-unused-parameters: Properly handle static class members.Daniel Jasper2015-07-281-0/+6
| | | | | | Not sure why I wrote what I wrote before. llvm-svn: 243403
* misc-unused-parameters: Don't warn on ParmVarDecls in the return type.Daniel Jasper2015-07-271-0/+5
| | | | | | | | | As there don't seem to be a good way of formulating a matcher that finds all pairs of functions and their ParmVarDecls, just match on functionDecls and iterate over their parameters. This should also be more efficient as some checks are only performed once per function. llvm-svn: 243267
* misc-unused-parameters: Fix bug where the check was looking atDaniel Jasper2015-07-231-0/+2
| | | | | | ParmVarDecls of function types. llvm-svn: 243026
* misc-unused-parameters: Fix handling of parameters in template functions.Daniel Jasper2015-07-221-0/+11
| | | | | | | | | | | | | The parameters of the function templates were being marked as incorrectly be marked as unused. Added a test for this and changed the check to use the same isReferenced() || !getDeclName() logic as Sema::DiagnoseUnusedParameters. Patch Scott Wallace, thank you! llvm-svn: 242912
* Extend misc-unused-parameters to delete parameters of local functions.Daniel Jasper2015-07-201-0/+69
| | | | | | Also see: llvm.org/PR24180. llvm-svn: 242659
* Initial version of clang-tidy check to find and fix unused parameters.Daniel Jasper2015-07-201-0/+21
Also see: llvm.org/PR24180. llvm-svn: 242654
OpenPOWER on IntegriCloud