[PATCH] D48318: [analyzer][UninitializedObjectChecker] Drop lambda support

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


Szelethus created this revision.
Szelethus added reviewers: NoQ, george.karpenkov, xazax.hun, rnkovacs, dkrupp.
Herald added subscribers: cfe-commits, mikhail.ramalho, a.sidorin, szepet, whisperity.

After some thinking, I don't think this checker should support lambdas.

Reason 1.: While this is due to the analyzer not being smart enough just yet, the checker doesn't find uninitialized variables that were captured but value, but it does find find them if they were captured by reference. I think this makes little sense -- capturing by reference could be intentional, if the lambda function assigns a value to it, while capturing an undefined variable by value almost never makes sense. This could be fixed, but...

Reason 2.: I don't think lambda misuse should be the responsibility of this checker. It just doesn't make sense, as lambda misuse in not really an uninitialized value problem. It should rather be handled by a standalone lambda checker.


Repository:
  rC Clang

https://reviews.llvm.org/D48318

Files:
  lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
  test/Analysis/cxx-uninitialized-object.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48318.151881.patch
Type: text/x-patch
Size: 3985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180619/f7d75498/attachment.bin>


More information about the cfe-commits mailing list