summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a new clang-tidy check for cert-msc50-cpp (and cert-msc30-c) that ↵Aaron Ballman2016-11-023-0/+15
| | | | | | | | corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/MSC50-CPP.+Do+not+use+std%3A%3Arand%28%29+for+generating+pseudorandom+numbers Patch by Benedek Kiss llvm-svn: 285809
* [Documentation] Clang-tidy readability-redundant-declaration consistency.Eugene Zelenko2016-11-021-4/+6
| | | | | | Release notes checks order and consistent Clang-tidy readability-redundant-declaration description. llvm-svn: 285778
* [clang-tidy] Add check readability-redundant-declarationDaniel Marjamaki2016-11-012-0/+28
| | | | | | | | | | | Finds redundant variable and function declarations. extern int X; extern int X; // <- redundant Differential Revision: https://reviews.llvm.org/D24656 llvm-svn: 285689
* [clang-tidy] Update cert-err58-cpp to match its new generalised form.Malcolm Parsons2016-10-311-3/+3
| | | | | | | | | | | | | | Summary: Aaron modified cert-err58-cpp to include all exceptions thrown before main() Update the check to match. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25925 llvm-svn: 285653
* [clang-tidy] Enhance modernize-make-unique to handle unique_ptr.reset()Malcolm Parsons2016-10-312-0/+22
| | | | | | | | | | | | | | | Summary: Avoid naked new in unique_ptr.reset() by using make_unique Fixes http://llvm.org/PR27383 Reviewers: alexfh, aaron.ballman Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D25898 llvm-svn: 285589
* [clang-tidy] Enhance modernize-use-auto to castsMalcolm Parsons2016-10-311-1/+23
| | | | | | | | | | | | | | | | | | | | 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
* Remove 'misc-pointer-and-integral-operation' clang-tidy check. The only casesRichard Smith2016-10-212-25/+0
| | | | | | | it detects are ill-formed (some per C++ core issue 1512, others always have been). llvm-svn: 284888
* [clang-tidy] Add check 'readability-redundant-member-init'Malcolm Parsons2016-10-202-0/+21
| | | | | | | | | | | | Summary: The check emits a warning if a member-initializer calls the member's default constructor with no arguments. Reviewers: sbenza, alexfh, aaron.ballman Subscribers: modocache, mgorny, Eugene.Zelenko, etienneb, Prazek, hokein, cfe-commits, beanz Differential Revision: https://reviews.llvm.org/D24339 llvm-svn: 284742
* [clang-tidy] Add cert-err09-cpp check alias.Marek Kurdej2016-10-193-0/+12
| | | | | | | | | | | | Summary: This adds cert-err09-cpp alias for completeness, similar to cert-err61-cpp. Reviewers: alexfh, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25770 llvm-svn: 284596
* Fix typo in documentationMalcolm Parsons2016-10-111-1/+1
| | | | llvm-svn: 283865
* [clang-tidy] Add a whitelist option in google-runtime-references.Haojian Wu2016-10-101-0/+8
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25244 llvm-svn: 283777
* [clang-tidy] Add doc for `explain-config` option.Haojian Wu2016-09-221-0/+4
| | | | llvm-svn: 282158
* [clang-tidy] Add check 'misc-use-after-move'Martin Bohme2016-09-142-0/+198
| | | | | | | | | | | | | | | | Summary: The check warns if an object is used after it has been moved, without an intervening reinitialization. See user-facing documentation for details. Reviewers: sbenza, Prazek, alexfh Subscribers: beanz, mgorny, shadeware, omtcyfz, Eugene.Zelenko, Prazek, fowles, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D23353 llvm-svn: 281453
* [clang-tidy] Extend readability-container-size-empty to arbitrary class with ↵Kirill Bobyrev2016-09-131-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | size() and empty() This patch extends readability-container-size-empty check allowing it to produce warnings not only for STL containers, but also for containers, which provide two functions matching following signatures: * `size_type size() const;` * `bool empty() const;` Where `size_type` can be any kind of integer type. This functionality was proposed in https://llvm.org/bugs/show_bug.cgi?id=26823 by Eugene Zelenko. Approval: alexfh Reviewers: alexfh, aaron.ballman, Eugene.Zelenko Subscribers: etienneb, Prazek, hokein, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D24349 llvm-svn: 281307
* [clang-tidy] readability-misplaced-array-index: add new check that warns ↵Daniel Marjamaki2016-09-122-0/+28
| | | | | | | | | | when array index is misplaced. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D21134 llvm-svn: 281206
* [clang-tidy docs] Add missing option docs.Haojian Wu2016-08-3119-12/+217
| | | | | | | | | | Reviewers: alexfh, Eugene.Zelenko, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D23918 llvm-svn: 280236
* [clang-tidy docs] Fix build errors on Sphinx 1.4.6Haojian Wu2016-08-302-4/+4
| | | | llvm-svn: 280095
* [clang-tidy] Add check 'misc-move-forwarding-reference'Martin Bohme2016-08-302-0/+61
| | | | | | | | | | | | | | | | | | | | | | | Summary: The check emits a warning if std::move() is applied to a forwarding reference, i.e. an rvalue reference of a function template argument type. If a developer is unaware of the special rules for template argument deduction on forwarding references, it will seem reasonable to apply std::move() to the forwarding reference, in the same way that this would be done for a "normal" rvalue reference. This has a consequence that is usually unwanted and possibly surprising: If the function that takes the forwarding reference as its parameter is called with an lvalue, that lvalue will be moved from (and hence placed into an indeterminate state) even though no std::move() was applied to the lvalue at the callsite. As a fix, the check will suggest replacing the std::move() with a std::forward(). This patch requires D23004 to be submitted before it. Reviewers: sbenza, aaron.ballman Subscribers: klimek, etienneb, alexfh, aaron.ballman, Prazek, Eugene.Zelenko, mgehre, cfe-commits Projects: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D22220 llvm-svn: 280077
* Fix some typos in the docSylvestre Ledru2016-08-283-5/+5
| | | | llvm-svn: 279944
* [Clang-tidy] Fix some checks documentation style.Eugene Zelenko2016-08-2630-179/+193
| | | | | | Differential revision: https://reviews.llvm.org/D23894 llvm-svn: 279846
* [clang-tidy] Some tweaks on header guard checks.Haojian Wu2016-08-261-1/+4
| | | | | | | | * Implement missing storeOption interfaces. * Remove unnecessary parameter copy in isHeaderFileExtension. * Fix doc style. llvm-svn: 279814
* [clang-tidy] Added hh, hxx and hpp to header guard checks.Mads Ravn2016-08-261-1/+8
| | | | | | | | Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h". Differential revision: https://reviews.llvm.org/D20512 llvm-svn: 279803
* Clang-tidy documentation style. Two Google checks are aliases.Eugene Zelenko2016-08-248-36/+29
| | | | | | Differential revision: https://reviews.llvm.org/D23815 llvm-svn: 279659
* [Documentation] Fix style of Clang-tidy readability-non-const-parameter.Eugene Zelenko2016-08-231-7/+9
| | | | llvm-svn: 279541
* [clang-tidy] readability-non-const-parameter: add new check that warns when ↵Daniel Marjamaki2016-08-232-0/+45
| | | | | | | | | | | | | | function parameters should be const The check will warn when the constness will make the function interface safer. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D15332 llvm-svn: 279507
* Fix style in some Clang-tidy checks documentation.Eugene Zelenko2016-08-237-42/+70
| | | | | | Differential revision: https://reviews.llvm.org/D23728 llvm-svn: 279494
* [clang-tidy docs] Further cleanup of optionsAlexander Kornienko2016-08-225-28/+41
| | | | llvm-svn: 279442
* [Documentation] Fixed style in modernize-use-emplace.rst.Eugene Zelenko2016-08-181-4/+3
| | | | llvm-svn: 279170
* [clang-tidy docs] Move option descriptions to the Options sectionAlexander Kornienko2016-08-183-22/+37
| | | | | | + random fixes llvm-svn: 279115
* [clang-tidy docs] Minor fixAlexander Kornienko2016-08-181-1/+1
| | | | llvm-svn: 279051
* [clang-tidy docs] Fix formatting.Alexander Kornienko2016-08-181-0/+1
| | | | llvm-svn: 279050
* [clang-tidy docs] Fix build errors on Sphinx 1.4.5Alexander Kornienko2016-08-188-48/+86
| | | | llvm-svn: 279049
* [Documentation] Remove duplicated checks groups descriptions from ↵Eugene Zelenko2016-08-171-23/+9
| | | | | | | | clang-tidy/index.rst. Differential revision: https://reviews.llvm.org/D23596 llvm-svn: 279006
* [Documentation] Improve checks groups descriptions in clang-tidy/index.rstEugene Zelenko2016-08-151-18/+17
| | | | | | | | Use table to avoid tautology. List all existing checks groups. Use alphabetical order. Differential revision: https://reviews.llvm.org/D23471 llvm-svn: 278686
* [clang-tidy] MPIBufferDerefCheck Alexander Droste2016-08-122-0/+26
| | | | | | | | | | | | | | | | | | ... This check verifies if a buffer passed to an MPI (Message Passing Interface) function is sufficiently dereferenced. Buffers should be passed as a single pointer or array. As MPI function signatures specify void * for their buffer types, insufficiently dereferenced buffers can be passed, like for example as double pointers or multidimensional arrays, without a compiler warning emitted. Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples Reviewers: Haojian Wu Differential revision: https://reviews.llvm.org/D22729 llvm-svn: 278553
* [Documentation] Fix style and grammar mistake in Clang-tidy ↵Eugene Zelenko2016-08-101-1/+1
| | | | | | readability-else-after-return description spotted by Alexander Kornienko. llvm-svn: 278279
* [Documentation] Highlighting consistency and spelling mistake fix in ↵Eugene Zelenko2016-08-101-3/+3
| | | | | | Clang-tidy readability-else-after-return description. llvm-svn: 278263
* [clang-tidy] enhance readability-else-after-returnKirill Bobyrev2016-08-101-2/+57
| | | | | | | | | | | | `readability-else-after-return` only warns about `return` calls, but LLVM Coding Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are bad, too. Reviwers: alexfh, aaron.ballman Differential Revision: https://reviews.llvm.org/D23265 llvm-svn: 278257
* [Documentation] Fix grammar mistakes in docs/clang-tidy/index.rst spotted by ↵Eugene Zelenko2016-08-101-1/+1
| | | | | | Alexander Kornienko. llvm-svn: 278255
* [clang-tidy] minor improvements in modernise-deprecated-headers checkKirill Bobyrev2016-08-101-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a minor list of changes as proposed by Richard Smith in the mailing list. See original comments with an impact on the future check state below: [comments.begin > + {"complex.h", "ccomplex"}, It'd be better to convert this one to <complex>, or leave it alone. <ccomplex> is an unnecessary wart. (The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of which are identical) aren't comparable to C99's <complex.h>, so if this was C++98 code using the C99 header, the code will be broken with or without this transformation.) > + {"iso646.h", "ciso646"}, Just delete #includes of this one. <ciso646> does nothing. > + {"stdalign.h", "cstdalign"}, > + {"stdbool.h", "cstdbool"}, We should just delete these two includes. These headers do nothing in C++. comments.end] Reviewers: alexfh, aaron.ballman Differential Revision: https://reviews.llvm.org/D17990 llvm-svn: 278254
* [Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.Eugene Zelenko2016-08-101-5/+5
| | | | llvm-svn: 278198
* [clang-tidy] enhance modernize-use-bool-literals to check ternary operatorKirill Bobyrev2016-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | modernize-use-bool-literals doesn't checks operands in ternary operator. For example: ``` c++ static int Value = 1; bool foo() { bool Result = Value == 1 ? 1 : 0; return Result; } bool boo() { return Value == 1 ? 1 : 0; } ``` This issue was reported in bug 28854. The patch fixes it. Reviewers: alexfh, aaron.ballman, Prazek Subscribers: Prazek, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D23243 llvm-svn: 278022
* [clang-tidy] misc-argument-comment non-strict modeAlexander Kornienko2016-08-041-0/+4
| | | | | | | | | | | | | | | | | Summary: The misc-argument-comment check now ignores leading and trailing underscores and case. The new `StrictMode` local/global option can be used to switch back to strict checking. Add getLocalOrGlobal version for integral types, minor cleanups. Reviewers: hokein, aaron.ballman Subscribers: aaron.ballman, Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D23135 llvm-svn: 277729
* [clang-tidy] Inefficient string operationAlexander Kornienko2016-08-032-0/+50
| | | | | | | | Patch by Bittner Barni! Differential revision: https://reviews.llvm.org/D20196 llvm-svn: 277677
* [clang-tidy] address concerns with rL277340Kirill Bobyrev2016-08-031-18/+18
| | | | | | | | | | alexfh raised a concern with https://reviews.llvm.org/rL277340 After retabbing indentation of .. code-block:: was increased to 8, 4 spaces indentation should be enough. Reviewers: alexfh llvm-svn: 277577
* [clang-tidy] MPITypeMismatchCheckAlexander Kornienko2016-08-022-0/+21
| | | | | | | | | | | | | | | | This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match. All MPI datatypes defined by the MPI standard (3.1) are verified by this check. User defined typedefs, custom MPI datatypes and null pointer constants are skipped, in the course of verification. Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples Patch by Alexander Droste! Differential revision: https://reviews.llvm.org/D21962 llvm-svn: 277516
* [clang-tidy] remove trailing whitespaces and retabKirill Bobyrev2016-08-012-26/+26
| | | | llvm-svn: 277340
* [clang-tidy] add check cppcoreguidelines-special-member-functionsJonathan Coe2016-07-302-0/+22
| | | | | | | | | | | | | | | | | | | Summary: Check for classes that violate the rule of five and zero as specified in CppCoreGuidelines: "If a class defines or deletes a default operation then it should define or delete them all." https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all. Reviewers: alexfh, sbenza, aaron.ballman Subscribers: Prazek, Eugene.Zelenko, cfe-commits, ericLemanissier, nemanjai Projects: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D22513 llvm-svn: 277262
* [clang-tidy] Fixes to modernize-use-emplacePiotr Padlewski2016-07-291-14/+34
| | | | | | | | Not everything is valid, but it should works for 99.8% cases https://reviews.llvm.org/D22208 llvm-svn: 277097
* [clang-tidy] Add cppcoreguidelines-slicing entry to list.rst.Haojian Wu2016-07-271-0/+1
| | | | llvm-svn: 276861
OpenPOWER on IntegriCloud