Fix testrunner
This commit is contained in:
parent
ab14d2bc0f
commit
693b24d30a
|
@ -1200,11 +1200,12 @@ static bool canBeConst(const Variable *var)
|
||||||
else if (parent->isAssignmentOp()) {
|
else if (parent->isAssignmentOp()) {
|
||||||
if (parent->astOperand1() == tok2)
|
if (parent->astOperand1() == tok2)
|
||||||
return false;
|
return false;
|
||||||
else if (parent->astOperand1()->str() == "&") {
|
const Variable* assignedVar = parent->astOperand1() ? parent->astOperand1()->variable() : nullptr;
|
||||||
const Variable* assignedVar = parent->previous()->variable();
|
if (assignedVar &&
|
||||||
if (!assignedVar || !assignedVar->isConst())
|
!assignedVar->isConst() &&
|
||||||
|
assignedVar->isReference() &&
|
||||||
|
assignedVar->nameToken() == parent->astOperand1())
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
} else if (Token::Match(tok2, "%var% . %name% (")) {
|
} else if (Token::Match(tok2, "%var% . %name% (")) {
|
||||||
const Function* func = tok2->tokAt(2)->function();
|
const Function* func = tok2->tokAt(2)->function();
|
||||||
if (func && (func->isConst() || func->isStatic()))
|
if (func && (func->isConst() || func->isStatic()))
|
||||||
|
|
Loading…
Reference in New Issue