[PATCH] D59540: [clang-tidy] [PR41119] readability-identifier-naming incorrectly fixes lambda capture

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 11:58:57 PDT 2019


MyDeveloperDay marked 5 inline comments as done.
MyDeveloperDay added inline comments.


================
Comment at: test/clang-tidy/readability-identifier-naming.cpp:509
+// CHECK-FIXES: {{^}}  bool columns=false;
+  auto ptr=[&]{return Columns;}();
+// CHECK-FIXES: {{^}}  auto ptr=[&]{return columns;}();
----------------
alexfh wrote:
> Please add more tests with
>   1) by value automatic captures
>   2) manual captures by value
>   3) manual captures by reference
>   4) nested lambdas capturing the same variable
> 
> A bit more nested code inside the lambda would also be interesting (where the use of the variable would be wrapped in a couple of compound statements).
Think i've covered the cases you wanted here, if you can think of another drop the code into a comment and I'll add it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59540/new/

https://reviews.llvm.org/D59540





More information about the cfe-commits mailing list