[PATCH] D125949: [clang-tidy] modernize-avoid-bind: Fix crash when method name is not a simple identifier
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 19 08:34:15 PDT 2022
njames93 added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-avoid-bind.cpp:367
+ // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: prefer a lambda to std::bind
+ // CHECK-FIXES: auto EEE = [d] { d->operator()(1, 2); }
+
----------------
Fixing a crash is good, but these fixes leave a lot to be desired. If you could handle the cases when the name is an operator call by actually using the operator it would be be a lot nicer.
```lang=c++
auto EEE = [d] { d(1, 2); };
```
This definitely could be done in a follow up commit.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125949/new/
https://reviews.llvm.org/D125949
More information about the cfe-commits
mailing list