summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Add check 'modernize-return-braced-init-list'Jonas Devlieghere2017-02-154-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Replaces explicit calls to the constructor in a return with a braced initializer list. This way the return type is not needlessly duplicated in the return type and the return statement. ``` Foo bar() { Baz baz; return Foo(baz); } // transforms to: Foo bar() { Baz baz; return {baz}; } ``` Reviewers: hokein, Prazek, aaron.ballman, alexfh Reviewed By: Prazek, aaron.ballman, alexfh Subscribers: malcolm.parsons, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D28768 llvm-svn: 295199
* [clang-tidy] Ignore instantiated functions and static data members of ↵Haojian Wu2017-02-151-3/+4
| | | | | | | | | | | | | | classes in misc-definitions-in-headers. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29957 llvm-svn: 295178
* [clang-tidy] Don't warn about call to unresolved operator*Malcolm Parsons2017-02-151-1/+4
| | | | | | | | | | | | | | | | | | Summary: The misc-unconventional-assign-operator check had a false positive warning when the 'operator*' in 'return *this' was unresolved. Change matcher to allow calls to unresolved operator. Fixes PR31531. Reviewers: alexfh, aaron.ballman Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29393 llvm-svn: 295176
* [clang-tidy] Add support for NOLINTNEXTLINE.Benjamin Kramer2017-02-141-0/+29
| | | | | | | | | | Reviewers: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29899 llvm-svn: 295049
* [clang-tidy] Improve diagnostic message for misc-definitions-in-header.Haojian Wu2017-02-141-3/+5
| | | | | | | | | | | | | | | | | | | Summary: Users might get confused easily when they see the check's message on full template function speciliations. Add a note to the output message, which mentions these kind of function specializations are treated as regular functions. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29928 llvm-svn: 295048
* [clang-tidy] Add readability-misleading-indentation check.Gabor Horvath2017-02-144-0/+148
| | | | | | Differential Revision: https://reviews.llvm.org/D19586 llvm-svn: 295041
* [clang-tidy] Reduce indentation. NFC.Benjamin Kramer2017-02-131-10/+10
| | | | llvm-svn: 294974
* [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not ↵Mads Ravn2017-02-121-1/+1
| | | | | | | | work for class members Fix for commit r294912 which had a small error in the AST matcher. llvm-svn: 294913
* [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not ↵Mads Ravn2017-02-122-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | work for class members I have made a small fix for readability-delete-null-pointer check so it also checks for class members. Example of case that it fixes ``` struct A { void foo() { if(mp) delete mp; } int *mp; }; ``` Reviewers: JDevlieghere, aaron.ballman, alexfh, malcolm.parsons Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29726 llvm-svn: 294912
* [clang-tidy] Fix handling of function types in google-readability-castingAlexander Kornienko2017-02-101-7/+26
| | | | llvm-svn: 294751
* [clang-tidy] Add -quiet option to suppress extra outputEhsan Akhgari2017-02-093-10/+32
| | | | | | | | | | | | | | | Summary: This new flag instructs clang-tidy to not output anything except for errors and warnings. This makes it easier to script clang-tidy to run as part of external build systems. Reviewers: bkramer, alexfh, klimek Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29661 llvm-svn: 294607
* [clang-tidy] Fix misc-unused-using-decls false positives in presence of ↵Alexander Kornienko2017-02-091-0/+3
| | | | | | compile errors llvm-svn: 294578
* [clang-tidy] Add -extra-arg and -extra-arg-before to clang-tidy-diff.pyEhsan Akhgari2017-02-081-0/+12
| | | | | | | | | | | | | | Summary: These flags allow specifying extra arguments to the tool's command line which don't appear in the compilation database. Reviewers: alexfh, klimek, bkramer Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29699 llvm-svn: 294491
* [clang-tidy] hasErrorOccurred() -> hasUncompilableErrorOccurred()Alexander Kornienko2017-02-082-2/+2
| | | | | | | hasErrorOccurred() -> hasUncompilableErrorOccurred(), since we only care about errors that lead to invalid AST. llvm-svn: 294467
* [clang-tidy] Supresses misc-move-constructor-init warning for const fields.Alexander Kornienko2017-02-081-0/+3
| | | | | | | | Patch by CJ DiMeglio! Differential revision: https://reviews.llvm.org/D28973 llvm-svn: 294459
* [clang-tidy] misc-argument-comment - extended gmock supportAlexander Kornienko2017-02-071-22/+32
| | | | | | | It looks like direct calls to mocked methods happen in the wild. This patch add support for these as well. llvm-svn: 294293
* [clang-tidy] Cleanup of no-assembler checkJonathan Coe2017-02-071-3/+2
| | | | | | Address outstanding comments from https://reviews.llvm.org/D29267 llvm-svn: 294283
* [clang-tidy] safety-no-assemblerJonathan Coe2017-02-067-0/+146
| | | | | | | | | | | | | | | | | | | Summary: Add a new clang-tidy module for safety-critical checks. Include a check for inline assembler. Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode Reviewed By: idlecode Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D29267 llvm-svn: 294255
* [clang-tidy] misc-argument-comment support for gmockAlexander Kornienko2017-02-062-47/+124
| | | | | | | | Now for real. The use case supported previously is used by approximately nobody. What's needed is support for matching argument comments in EXPECT_xxx calls to the names of parameters of the mocked methods. llvm-svn: 294193
* [clang-tidy] getPreviousNonCommentToken -> getPreviousTokenAlexander Kornienko2017-02-065-11/+10
| | | | llvm-svn: 294192
* [clang-tidy] misc-argument-comment support for gmockAlexander Kornienko2017-02-021-0/+17
| | | | llvm-svn: 293845
* [clang-tidy] misc-argument-comment: ignore comments after argumentsAlexander Kornienko2017-02-011-2/+5
| | | | llvm-svn: 293771
* [clang-tidy] Remove debug logging.Alexander Kornienko2017-02-011-5/+0
| | | | llvm-svn: 293763
* Revert "Implement a new clang-tidy check that suggests users replace dynamic ↵Diana Picus2017-01-274-166/+0
| | | | | | | | | exception specifications with noexcept exception specifications." This reverts commit r293217, its follow-up 293218 and part of 293234 because it broke all bots that build clang-tools-extra. llvm-svn: 293267
* Implement a new clang-tidy check that suggests users replace dynamic ↵Aaron Ballman2017-01-264-0/+166
| | | | | | | | exception specifications with noexcept exception specifications. Patch by Don Hinton. llvm-svn: 293217
* [clang-tidy] Don't modernize-raw-string-literal if replacement is longer.Gabor Horvath2017-01-242-7/+17
| | | | | | | | | | Fixes PR30964. The old behavior can be achieved using a setting. Patch by: Andras Leitereg! Differential Revision: https://reviews.llvm.org/D28667 llvm-svn: 292938
* [clang-tidy] Avoid incorrect fixes in modernize-use-usingAlexander Kornienko2017-01-241-21/+38
| | | | | | | Avoid fixes for typedefs with multiple types and for typedefs with struct definitions. Partially addresses http://llvm.org/PR28334 llvm-svn: 292918
* [clang-tidy] Ignore implicit functions in performance-unnecessary-value-paramMalcolm Parsons2017-01-231-1/+1
| | | | | | | | | | | | | | | | | Summary: The performance-unnecessary-value-param check mangled inherited constructors, as the constructors' parameters do not have useful source locations. Fix this by ignoring implicit functions. Fixes PR31684. Reviewers: flx, alexfh, aaron.ballman Subscribers: madsravn, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29018 llvm-svn: 292786
* [clang-tidy] Do not trigger move fix for non-copy assignment operators in ↵Felix Berger2017-01-191-1/+2
| | | | | | | | | | | | performance-unnecessary-value-param check Reviewers: alexfh, sbenza, malcolm.parsons Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D28899 llvm-svn: 292491
* [clang-tidy] Add -extra-arg and -extra-arg-before to run-clang-tidy.pyEhsan Akhgari2017-01-181-2/+15
| | | | | | | | | | | | Summary: These flags allow specifying extra arguments to the tool's command line which don't appear in the compilation database. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D28334 llvm-svn: 292415
* [clang-tidy] Fix crash in modernize-use-using (http://llvm.org/PR29135)Alexander Kornienko2017-01-171-33/+26
| | | | llvm-svn: 292229
* Update tools to use new getStyle APIAntonio Maiorano2017-01-171-2/+6
| | | | | | | | Depends on https://reviews.llvm.org/D28081 Differential Revision: https://reviews.llvm.org/D28315 llvm-svn: 292175
* Remove unused lambda captures. NFCMalcolm Parsons2017-01-131-1/+1
| | | | llvm-svn: 291940
* [clang-tidy] Fix check for trivially copyable types in modernize-pass-by-valueMalcolm Parsons2017-01-121-1/+2
| | | | | | | | | | | | | | | Summary: rL270567 excluded trivially copyable types from being moved by modernize-pass-by-value, but it didn't exclude references to them. Change types used in the tests to not be trivially copyable. Reviewers: madsravn, aaron.ballman, alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D28614 llvm-svn: 291796
* Correctly classify main file includes if there is a prefix addedAlexander Kornienko2017-01-121-1/+2
| | | | | | | | | | | | | | | | | Summary: Prevents misclassifying includes based on the command-line filename (e.g. if a project is in a subdirectory). This is slightly more robust than the additional duplicate detection, however the current classification scheme is still kind of brittle for a lot of code. Reviewers: hokein, alexfh Subscribers: cfe-commits, #clang-tools-extra Patch by Julian Bangert! Differential Revision: https://reviews.llvm.org/D26015 llvm-svn: 291767
* [clang-tidy] Ignore default arguments in modernize-default-member-initMalcolm Parsons2017-01-041-1/+1
| | | | | | | | | | | | | | | | | Summary: Default member initializers cannot refer to constructor parameters, but modernize-default-member-init was trying to when the default constructor had default arguments. Change the check to ignore default arguments to the default constructor. Fixes PR31524. Reviewers: alexfh, aaron.ballman Subscribers: cfe-commits, JDevlieghere, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D28287 llvm-svn: 290972
* [clang-tidy] Add check name to YAML export (clang-tools-extra part)Alexander Kornienko2017-01-035-86/+41
| | | | | | | | | | | | Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option. Update clang-apply-replacements to handle the new format. Patch by Alpha Abdoulaye! Differential revision: https://reviews.llvm.org/D26137 llvm-svn: 290893
* [clang-tidy] Handle constructors in performance-unnecessary-value-paramMalcolm Parsons2017-01-033-42/+87
| | | | | | | | | | | | | | Summary: modernize-pass-by-value doesn't warn about value parameters that cannot be moved, so performance-unnecessary-value-param should. Reviewers: aaron.ballman, flx, alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D28022 llvm-svn: 290883
* [clang-tidy] Add delete null pointer check.Gabor Horvath2016-12-314-0/+115
| | | | | | | | | | This check detects and fixes redundant null checks before deletes. Patch by: Gergely Angeli! Differential Revision: https://reviews.llvm.org/D21298 llvm-svn: 290784
* [clang-tidy] google-explicit-constructor: ignore macrosAlexander Kornienko2016-12-301-0/+4
| | | | llvm-svn: 290756
* [clang-tidy] google-explicit-constructor: ignore template instantiationsAlexander Kornienko2016-12-301-2/+4
| | | | llvm-svn: 290753
* [clang-tidy] Add check 'misc-string-compare'.Mads Ravn2016-12-304-0/+121
| | | | | | | | | | | | | | | | | | | I have a created a new check for clang tidy: misc-string-compare. This will check for incorrect usage of std::string::compare when used to check equality or inequality of string instead of the string equality or inequality operators. Example: ``` std::string str1, str2; if (str1.compare(str2)) { } ``` Reviewers: hokein, aaron.ballman, alexfh, malcolm.parsons Subscribers: xazax.hun, Eugene.Zelenko, cfe-commits, malcolm.parsons, Prazek, mgorny, JDevlieghere Differential Revision: https://reviews.llvm.org/D27210 llvm-svn: 290747
* [clang-tidy] google-explicit-constructor: ignore compiler-generated ↵Alexander Kornienko2016-12-281-2/+5
| | | | | | conversion operators. llvm-svn: 290668
* [clang-tidy] Make 2 checks register matchers for C++ only.Malcolm Parsons2016-12-272-0/+6
| | | | llvm-svn: 290633
* [clang-tidy] Add enum misuse check.Gabor Horvath2016-12-274-0/+259
| | | | | | | | | | | The checker detects various cases when an enum is probably misused (as a bitmask). Patch by: Peter Szecsi! Differential Revision: https://reviews.llvm.org/D22507 llvm-svn: 290600
* [clang-tidy] Remove local hasInClassInitializer matcher. NFCMalcolm Parsons2016-12-241-10/+7
| | | | llvm-svn: 290493
* [clang-tidy] refactor ExprSequence out of use-after-move checkMarek Sokolowski2016-12-244-261/+310
| | | | | | Differential Revision: https://reviews.llvm.org/D27700 llvm-svn: 290489
* [clang-tidy] Flag implicit conversion operators.Alexander Kornienko2016-12-231-9/+21
| | | | llvm-svn: 290434
* [clang-tidy] cppcoreguidelines-slicing: display discarded state size in bytesClement Courbet2016-12-221-2/+3
| | | | | | https://reviews.llvm.org/D27212 llvm-svn: 290340
* [clang-tidy] Ignore `size() == 0` in the container implementation.Alexander Kornienko2016-12-211-1/+3
| | | | llvm-svn: 290289
OpenPOWER on IntegriCloud