[PATCH] D52281: Use std::invoke in generic code

Borsik Gábor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 19 14:40:51 PDT 2018


boga95 created this revision.
boga95 added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, mgorny.

In generic code (e.g.: in a type dependent expression), the `std::invoke` should be used, in order to support functors, function pointers, pointers to members, regular functions, and other C++ and STL features: link <http://en.cppreference.com/w/cpp/utility/functional/invoke>
The check replace the appropriate calls with calls to std::invoke. This should work only in C++17 and newer codebases.


Repository:
  rCTE Clang Tools Extra

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
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/modernize-replace-generic-functor-call.rst
  test/clang-tidy/modernize-replace-generic-functor-call.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52281.166185.patch
Type: text/x-patch
Size: 11935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180919/6eb5b283/attachment-0001.bin>


More information about the cfe-commits mailing list