This commit is contained in:
parent
18a7a805df
commit
3faff5e9fc
|
@ -7497,6 +7497,7 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, const Token * const tokEnd, co
|
|||
varName = varName->link()->previous();
|
||||
endDecl->insertToken(";");
|
||||
endDecl = endDecl->next();
|
||||
endDecl->next()->isSplittedVarDeclEq(true);
|
||||
endDecl->insertToken(varName->str());
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -5292,7 +5292,7 @@ static void valueFlowAfterAssign(TokenList *tokenlist, SymbolDatabase* symboldat
|
|||
});
|
||||
if (values.empty())
|
||||
continue;
|
||||
const bool init = vars.size() == 1 && vars.front()->nameToken() == tok->astOperand1();
|
||||
const bool init = vars.size() == 1 && (vars.front()->nameToken() == tok->astOperand1() || tok->isSplittedVarDeclEq());
|
||||
valueFlowForwardAssign(
|
||||
tok->astOperand2(), tok->astOperand1(), vars, values, init, tokenlist, errorLogger, settings);
|
||||
// Back propagate symbolic values
|
||||
|
|
|
@ -3935,7 +3935,7 @@ private:
|
|||
" if (logger == nullptr)\n"
|
||||
" logger = Fun;\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("", "[test.cpp:5]: (style) Condition 'logger==nullptr' is always true\n", errout.str());
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void Fun();\n"
|
||||
"typedef void (*Fn)();\n"
|
||||
|
|
Loading…
Reference in New Issue