[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2019-09-18 Thread Borsik Gábor via Phabricator via cfe-commits
boga95 marked an inline comment as done. boga95 added a comment. Resolving the problems properly seemed quite difficult. I just finished university and started to work, therefore I don't have enough free time to finish the checker. Sorry about that. CHANGES SINCE LAST ACTION

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2019-09-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The review says you abandoned it -- was that accidental? Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:72 + +const Expr *Obj = BinOp->getLHS(); +const std::string ObjName = boga95 wrote: > I found an

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2019-09-17 Thread Borsik Gábor via Phabricator via cfe-commits
boga95 abandoned this revision. boga95 marked 4 inline comments as done. boga95 added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:72 + +const Expr *Obj = BinOp->getLHS(); +const std::string ObjName = I found an

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-10-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:32 + // ::std::invoke(func, 1) + Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"), this); + I don't think this will work for calls wrapped

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-10-02 Thread Borsik Gábor via Phabricator via cfe-commits
boga95 updated this revision to Diff 167991. boga95 marked 7 inline comments as done. https://reviews.llvm.org/D52281 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:70 +const auto *Paren = dyn_cast(MFunctor->getCallee()); +const auto *BinOp = dyn_cast(Paren->getSubExpr()); + How do you know `Paren` won't be null?

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-25 Thread Borsik Gábor via Phabricator via cfe-commits
boga95 updated this revision to Diff 166994. boga95 marked 12 inline comments as done. https://reviews.llvm.org/D52281 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:70 + if (MFunctor && MFunctor->isTypeDependent()) { +const auto *Paren = static_cast(MFunctor->getCallee()); +const auto *BinOp = JonasToth wrote: >

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:70 + if (MFunctor && MFunctor->isTypeDependent()) { +const auto *Paren = static_cast(MFunctor->getCallee()); +const auto *BinOp = Eugene.Zelenko wrote:

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-22 Thread Borsik Gábor via Phabricator via cfe-commits
boga95 updated this revision to Diff 166604. https://reviews.llvm.org/D52281 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp clang-tidy/modernize/ReplaceGenericFunctorCallCheck.h

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:27-32 + // template + // void f(T func) { + // func(); + // ^~~ + // ::std::invoke(func, 1) + Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"),

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:27-32 + // template + // void f(T func) { + // func(); + // ^~~ + // ::std::invoke(func, 1) + Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"),

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:27-32 + // template + // void f(T func) { + // func(); + // ^~~ + // ::std::invoke(func, 1) + Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"),

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-20 Thread Paul Fultz II via Phabricator via cfe-commits
pfultz2 added a comment. This needs a test when calling in a `constexpr` function. I believe `std::invoke` is not `constepxr`, so a function object call in a `constexpr` function should not suggest `std::invoke`. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52281

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:27-32 + // template + // void f(T func) { + // func(); + // ^~~ + // ::std::invoke(func, 1) + Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"),

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-19 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Looks like you patch is not based on trunk. Please rebase. Comment at: docs/ReleaseNotes.rst:60 +- New `modernize-replace-generic-functor-call + `_

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-19 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:114 +} +} // namespace modernize +} // namespace tidy Please insert empty line above. Repository: rCTE Clang Tools Extra