Enables the users to specify an optional flag which would warn for more dead stores.
Previously it ignored if the dead store happened e.g. in an if condition.
if ((X = generate())) { // dead store to X }
This patch introduces the WarnForDeadNestedAssignments option to the checker, which is false by default - so this change would not affect any previous users.
I have updated the code, tests and the docs as well. If I missed something, tell me.
I also ran the analysis on Clang which generated 14 more reports compared to the unmodified version. All of them seemed reasonable for me.
Shouldn't we enable this option by default?
You can check those at this CodeChecker instance. Note that this link will no longer work after the patch has been accepted.
Related previous patches:
rGf224820b45c6847b91071da8d7ade59f373b96f3
I suggest we adopt the idiom of passing the Checker object around and asking it about its options instead of passing each option around separately. This is easier and i don't see any downsides. Moreover, we already pass the Checker around (just type-erased for no good reason). If you don't mind, i'll remove this field as part of resolving merge conflicts in D65182.