summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* AvoidBindCheck.cpp: Fix unused variables warningHans Wennborg2019-12-031-2/+2
|
* AvoidBindCheck.cpp: Fix GCC 5.3 build errorsHans Wennborg2019-12-031-17/+17
| | | | | | | | | | | | | It was failing with: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:61:29: error: declaration of ‘clang::tidy::modernize::{anonymous}::CaptureMode clang::tidy::modernize::{anonymous}::BindArgument::CaptureMode’ [-fpermissive] CaptureMode CaptureMode = CM_None; ^ clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:38:6: error: changes meaning of ‘CaptureMode’ from ‘enum clang::tidy::modernize::{anonymous}::CaptureMode’ [-fpermissive] enum CaptureMode { CM_None, CM_ByRef, CM_ByValue, CM_InitExpression }; ^
* [clang-tidy] Rewrite modernize-avoid-bind check.Zachary Turner2019-12-021-58/+540
| | | | | | | | | | | | | | | | | | | This represents largely a full re-write of modernize-avoid-bind, adding significant new functionality in the process. In particular: * Both boost::bind and std::bind are now supported * Function objects are supported in addition to functions * Member functions are supported * Nested calls are supported using capture-init syntax * std::ref() and boost::ref() are now recognized, and will capture by reference. * Rather than capturing with a global =, we now build up an individual capture list that is both necessary and sufficient for the call. * Fixits are supported in a much larger variety of scenarios than before. All previous tests pass under the re-write, but a large number of new tests have been added as well. Differential Revision: https://reviews.llvm.org/D70368
* [NFC] Refactor representation of materialized temporariesTyker2019-11-191-1/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* Revert "[NFC] Refactor representation of materialized temporaries"Nico Weber2019-11-171-1/+1
| | | | | | This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, see comments on https://reviews.llvm.org/D69360
* [NFC] Refactor representation of materialized temporariesTyker2019-11-161-1/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* [clang-tidy] Fixed a std::bind() transformationJonas Toth2019-02-071-1/+1
| | | | | | | | There was an extra semicolon that was somehow working in some contexts. Patch by oleg.smolsky. llvm-svn: 353389
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 llvm-svn: 339401
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-2/+2
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* Fix some Clang-tidy modernize-use-default and Include What You Use warnings; ↵Eugene Zelenko2016-11-291-3/+17
| | | | | | | | other minor fixes (NFC). This preparation to remove SetVector.h dependency on SmallSet.h. llvm-svn: 288175
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-1/+1
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [Clang-tidy]: Fix modernize-avoid-bind erroneous scope resolution.Haojian Wu2016-10-201-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello, i would like to suggest a fix for one of the checks in clang-tidy and i should hope this one is the correct mailing list. The check is modernize-avoid-bind. Consider the following: void bar(int x, int y); namespace N { void bar(int x, int y); } void foo(){ auto Test = std::bind(N::bar,1,1); } clang-tidy’s modernize-avoid-bind check suggests writing: void foo(){ auto Test =[] {return bar(1,1);}; } instead of: void foo(){ auto Test = [] {return N::bar(1,1);}; } So clang-tidy has proposed an incorrect Fix. Patch by IdrissRio! Reviewers: alexfh, hokein, aaron.ballman Subscriber: cfe-commits llvm-svn: 284719
* [clang-tidy] Adds modernize-avoid-bind checkJonathan Coe2016-05-121-0/+163
Summary: This patch adds a check that replaces std::bind with a lambda. Not yet working for member functions. Reviewers: aaron.ballman, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16962 llvm-svn: 269341
OpenPOWER on IntegriCloud