summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] bug fix: Don't warn on partial template specialization in ↵Haojian Wu2016-02-031-1/+4
| | | | | | | | | | | | `misc-definitions-in-headers` check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16578 llvm-svn: 259643
* clang-tidy: [misc-unused-parameters] Ignore template instantiations.Daniel Jasper2016-02-031-1/+2
| | | | | | | | | No functional changes intended as we should already do the corresponding fixes when visiting the primary template. There are existing tests that verify that we do change unused parameters of templated functions. llvm-svn: 259640
* [clang-tidy] Fix minor style issues. NFCAlexander Kornienko2016-01-291-2/+1
| | | | llvm-svn: 259198
* Fixed function params comparison. Updated docs and tests.Alexander Kornienko2016-01-292-38/+40
| | | | | | | | | | | | | | Summary: "checkParamTypes" may fail if the the type of some parameter is not canonical. Fixed it by comparing canonical types. And added "getCanonicalType()" and "getCanonicalDecl()" on more places to prevent potential fail. Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D16587 llvm-svn: 259197
* Remove autoconf supportChris Bieneman2016-01-261-12/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Fix crashing on user-defined conversion.Alexander Kornienko2016-01-261-3/+5
| | | | | | | | | | | | | | Summary: Fix the assertion failure for the user-defined conversion method. e.g.: operator bool() Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D16536 llvm-svn: 258801
* Add support to the misc-assert-side-effect check for MSVC-style assert ↵Aaron Ballman2016-01-251-4/+11
| | | | | | macros, which use !! instead of an if statement or a conditional operator. llvm-svn: 258714
* [clang-tidy] Handle decayed types and other improvements in VirtualNearMiss ↵Gabor Horvath2016-01-222-36/+31
| | | | | | | | | | | check. Handle decayed types, ignore qualifiers and accessibility when considering a method as a possible overload. Differential Revision: http://reviews.llvm.org/D16179 llvm-svn: 258562
* [clang-tidy] Slightly clarified comments.Alexander Kornienko2016-01-131-2/+2
| | | | llvm-svn: 257600
* Support virtual-near-miss check.Alexander Kornienko2016-01-134-0/+335
| | | | | | | | | | | | | | Summary: Virtual function override near miss detection. Function complete. Test complete. Do not conduct Fix for now. Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D15823 llvm-svn: 257599
* [clang-tidy] Add non-inline function definition and variable definition ↵Alexander Kornienko2016-01-084-0/+173
| | | | | | | | | | | | | | | | check in header files. Summary: The new check will find all functionand variable definitions which may violate cpp one definition rule in header file. Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D15710 llvm-svn: 257178
* Disable part of the misc-move-constructor-init checker when the check is ↵Aaron Ballman2016-01-082-16/+23
| | | | | | enabled through cert-oop11-cpp. The CERT guideline does not cover moveable parameters as part of the OOP11-CPP recommendation, just copy construction from move constructors. llvm-svn: 257177
* [clang-tidy] Use proper capitalization and punctuation for diagnostic messages.Alexander Kornienko2016-01-081-1/+1
| | | | | | Use diagnostic parameters where possible instead of string concatenation. llvm-svn: 257176
* [clang-tidy] Fix a crash in misc-new-delete-overloadsAlexander Kornienko2015-12-161-42/+39
| | | | llvm-svn: 255758
* [clang-tidy] Check for suspicious string assignments.Gabor Horvath2015-12-154-0/+123
| | | | | | | | | | | It is possible to assign arbitrary integer types to strings. Sometimes it is the result of missing to_string call or apostrophes. Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D15411 llvm-svn: 255630
* [clang-tidy] Fix a typo in my latest commit.Alexander Kornienko2015-11-251-2/+2
| | | | llvm-svn: 254074
* [clang-tidy] Const std::move() argument ClangTidy checkAlexander Kornienko2015-11-254-0/+106
| | | | | | | | | | | | ClangTidy check for finding cases when std::move() is called with const or trivially copyable arguments, that doesn't lead to any move or argument but it makes copy. FixIt generates patch for removing call of std::move(). Patch by Vadym Doroshenko! (+ a couple of minor fixes) Differential Revision: http://reviews.llvm.org/D12031 llvm-svn: 254070
* [clang-tidy] code cleanup using isAssignmentOp()Daniel Marjamaki2015-11-251-5/+1
| | | | llvm-svn: 254066
* Fix bug in suggested fix that truncated variable names to 1 character.Samuel Benzaquen2015-11-111-30/+35
| | | | | | | | | | | | | | 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
* [clang-tidy] misc-macro-parentheses: fix fp when using object member pointersDaniel Marjamaki2015-11-101-1/+2
| | | | | | Fixes http://llvm.org/PR25208. llvm-svn: 252608
* Make a bunch of static arrays const.Craig Topper2015-10-182-3/+3
| | | | llvm-svn: 250641
* Expose the clang-tidy misc-assign-operator-signature checker as ↵Aaron Ballman2015-10-131-6/+7
| | | | | | cppcoreguidelines-c-copy-assignment-signature. llvm-svn: 250165
* Add a new checker that tests whether a throw expression throws by value, and ↵Aaron Ballman2015-10-094-0/+212
| | | | | | | | whether a catch statement catches by reference. Patch by Tobias Langner! llvm-svn: 249899
* Attempting to appease the CMake build bots after r249429.Aaron Ballman2015-10-061-0/+1
| | | | llvm-svn: 249430
* Improved the misc-move-constructor-init check to identify arguments that are ↵Aaron Ballman2015-10-062-5/+109
| | | | | | | | passed by value but copy assigned to class data members when the non-deleted move constructor is a better fit. Patch by Felix Berger! llvm-svn: 249429
* Adding a checker (misc-non-copyable-objects) that detects situations where a ↵Aaron Ballman2015-09-304-2/+132
| | | | | | non-copyable C type is being dereferenced, such as FILE or pthread_mutex_t. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object llvm-svn: 248907
* Adding a checker (misc-new-delete-overloads) that detects mismatched ↵Aaron Ballman2015-09-294-0/+256
| | | | | | overloads of operator new and operator delete. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/DCL54-CPP.+Overload+allocation+and+deallocation+functions+as+a+pair+in+the+same+scope llvm-svn: 248791
* [clang-tidy] Updated misc-unused-raii documentation.Alexander Kornienko2015-09-251-22/+2
| | | | llvm-svn: 248594
* misc-unused-parameter: Ignore lambda static invokers.Daniel Jasper2015-09-221-0/+3
| | | | llvm-svn: 248252
* Refactors AST matching code to use the new AST matcher names. This patch ↵Aaron Ballman2015-09-1712-52/+60
| | | | | | correlates to r247885 which performs the AST matcher rename in Clang. llvm-svn: 247886
* [clang-tidy] misc-sizeof-container: remove fix-it hintsAlexander Kornienko2015-09-141-40/+3
| | | | | | | This turned out to be a rather noisy check, so automated fixes will only do harm. Remove them completely. llvm-svn: 247578
* [clang-tidy] misc-sizeof-container: whitelist std::arrayAlexander Kornienko2015-09-141-1/+1
| | | | llvm-svn: 247559
* [clang-tidy] misc-sizeof-container: whitelist std::bitset<>.Alexander Kornienko2015-09-111-0/+1
| | | | | | | It's fine to use sizeof on std::bitset<>, since it doesn't have any external storage, everything's inside. llvm-svn: 247489
* [clang-tidy] Add misc-sizeof-container check to find sizeof() uses on stlAlexander Kornienko2015-09-104-0/+122
| | | | | | | | | | | | | | | | containers. Summary: sizeof(some_std_string) is likely to be an error. This check finds this pattern and suggests using .size() instead. Reviewers: djasper, klimek, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D12759 llvm-svn: 247297
* Allow the static assert clang-tidy checker to run over C code.Aaron Ballman2015-08-311-4/+3
| | | | llvm-svn: 246495
* Using an early return as it is more clear; NFC.Aaron Ballman2015-08-319-150/+158
| | | | llvm-svn: 246447
* [clang-tidy] misc-assert-side-effect: support assert macros defined through ↵Alexander Kornienko2015-08-311-14/+18
| | | | | | other macros llvm-svn: 246446
* Using an early return as it is more clear; NFC.Aaron Ballman2015-08-311-24/+24
| | | | llvm-svn: 246444
* [clang-tidy] Move misc-use-override and readability-shrink-to-fit to ↵Alexander Kornienko2015-08-314-232/+0
| | | | | | | | | "modernize/" These checks are focusing on migrating the code from C++98/03 to C++11, so they belong to the modernize module. llvm-svn: 246437
* Updated to make use of the AST matcher instead of a custom matcher; NFC.Aaron Ballman2015-08-281-4/+0
| | | | llvm-svn: 246325
* Disable clang-tidy misc checkers when not compiling in C++ mode. Many of the ↵Aaron Ballman2015-08-2811-146/+200
| | | | | | checkers do not require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. llvm-svn: 246318
* [clang-tidy] Update docs for clang-tidy checks. NFCAlexander Kornienko2015-08-2719-59/+83
| | | | | | | | | | | Changes mostly address formatting and unification of the style. Use MarkDown style for inline code snippets and lists. Added some text for a few checks. The idea is to move most of the documentation out to separate rST files and have implementation files refer to the corresponding documentation files. llvm-svn: 246169
* Add a new clang-tidy check (misc-move-constructor-init) that diagnoses move ↵Aaron Ballman2015-08-204-0/+113
| | | | | | constructor initializations that call copy constructors instead of move constructors. llvm-svn: 245571
* Insert override at the same line as the end of the function declarationEhsan Akhgari2015-08-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The existing check converts the code pattern below: void f() { } to: void f() override { } which is fairly sub-optimal. This patch fixes this by inserting the override keyword on the same line as the function declaration if possible, so that we instead get: void f() override { } We do this by looking for the last token before the start of the body and inserting the override keyword at the end of its location. Note that we handle const, volatile and ref-qualifiers correctly. Test Plan: Includes an automated test. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9286 llvm-svn: 245401
* [clang-tidy] Fixed typos and formatting in a comment. NFCAlexander Kornienko2015-08-181-5/+5
| | | | llvm-svn: 245310
* misc-unused-parameters: Fix crasher with C forward declarations thatDaniel Jasper2015-08-141-1/+2
| | | | | | can leave out the parameter list. llvm-svn: 245048
* misc-unused-parameters: Don't touch K&R style functions.Daniel Jasper2015-08-101-1/+2
| | | | | | We couldn't calculate the removal ranges properly at this point. llvm-svn: 244454
* [clang-tidy] Improve the misc-unused-alias-decl messageAlexander Kornienko2015-08-032-3/+4
| | | | | | "this namespace alias decl is unused" -> "namespace alias decl '...' is unused" llvm-svn: 243906
* Replace callback-if with isExpansionInMainFile as suggested in postDaniel Jasper2015-08-031-6/+4
| | | | | | commit review. llvm-svn: 243871
* Add missing 'override'.Daniel Jasper2015-07-311-1/+1
| | | | llvm-svn: 243773
OpenPOWER on IntegriCloud