some cleanups#4308
Conversation
|
Some of these things should have been caught by us. Will dig into those soon and file tickets. |
|
Just for fun - scanning Clang 13 ( Not so much fun. Quite baffling how it takes more if we removed code. Will try to look into it. The flakiness of the compiler optimizations are getting extremely annoying. Turns out the regression is caused by |
|
Will the |
| auto captureVariable = [&](const Token* tok2, LifetimeCapture c, std::function<bool(const Token*)> pred) { | ||
| if (varids.count(tok->varId()) > 0) | ||
| return; | ||
| ErrorPath errorPath; |
There was a problem hiding this comment.
I assume this is https://trac.cppcheck.net/ticket/9823 since the unused variable is inside a lamdba.
There was a problem hiding this comment.
Turns out there's a different issue related to having lamdba variables: https://trac.cppcheck.net/ticket/11215
| return conds; | ||
|
|
||
| Condition cond; | ||
| ValueFlow::Value true_value; |
There was a problem hiding this comment.
These are not detected since the class has another constructor with unknown implementation: https://trac.cppcheck.net/ticket/11216
There was a problem hiding this comment.
That other constructor has no side effects either but that is not visible. It might be helpful to configure this via a library: https://trac.cppcheck.net/ticket/11217
| if (ftok && argn >= 0) { | ||
| if (ftok->function()) { | ||
| std::vector<ValueType> result; | ||
| std::vector<const Variable*> argsVars = getArgumentVars(ftok, argn); |
There was a problem hiding this comment.
This was a bitch to reduce - super weird: https://trac.cppcheck.net/ticket/11218
These were encountered by looking at the changes suggested by the upcoming
misc-const-correctnessclang-tidy check and reviewing similar code. More PRs are coming.