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

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


Szelethus added a comment.

> [...]lambda misuse in not really an uninitialized value problem.

I guess you can make the argument that it its. Even then, in my opinion this checker is overkill for lambdas.

- If the captured variable has a non-default constructor, `UninitializedValueChecker` will analyze it,
- if the captured variable has a default constructor, or if `Pedantic` is disabled and all fields are uninitialized, we probably don't want to warn for them anyways,
- if the captured variable is primitive (`BuiltinType` or `EnumeralType`) we can just easily iterate over the captured fields to check whether they are undefined, and make a decision whether to warn for them or not.

My point is, a standalone `cplusplus.LambdaMisuse` checker would be a lot more fitting to handle these cases.

But I'd love to hear your thoughts on this one! This functionality could totally be squeezed into the checker (with better warning messages), if we were to come to the conclusion that it should be.


Repository:
  rC Clang

https://reviews.llvm.org/D48318





More information about the cfe-commits mailing list