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 in parens or with spurious 
dereferences.
```
void f(int) {}

int main() {
  void (*fp)(int) = f;

  fp(12);
  (fp)(12);
  (*fp)(12);
}
```
It seems like all of those can be replaced by `std::invoke()` directly.


================
Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:97
+             Functor->getSourceRange(),
+             (Twine("::std::invoke(") + Param +
+              (Functor->getNumArgs() == 0 ? "" : ", ") + OriginalParams)
----------------
You might be able to get rid of the explicit `Twine` construction here now that 
`Param` is a `Twine`. I could be remembering wrong though.


https://reviews.llvm.org/D52281



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to