[PATCH] D48291: [analyzer][UninitializedObjectChecker] Fixed captured lambda variable name

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 19 02:51:41 PDT 2018


Szelethus added a comment.

Thanks for the review!

I spend some time thinking about the support for lambda functions, and I start to think that checking for lambda misuse shouldn't be the responsibility of this checker. I created a new revision for that discussion, I wouldn't like to abandon this one until I heard what you think of this! :)
https://reviews.llvm.org/D48318



================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:687
+    CXXRecordDecl::capture_const_iterator CapturedVar =
+        std::find_if(CXXParent->captures_begin(), CXXParent->captures_end(),
+                     [&Field](const LambdaCapture &L) {
----------------
george.karpenkov wrote:
> Could we just use a for-each here? Sorry for being opinionated, I'm pretty sure it would be both shorter and more readable.
Great idea! :) I completely agree, to be honest I scratched my head too while I wrote it down.


Repository:
  rC Clang

https://reviews.llvm.org/D48291





More information about the cfe-commits mailing list