Tweaking CheckUninitVar (<< and >> handling)
This commit is contained in:
parent
7b10375683
commit
cc4977e140
|
@ -1012,7 +1012,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer, Alloc al
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tokenizer->isCPP() && Token::Match(vartok->next(), "<<|>>")) {
|
if (_tokenizer->isCPP() && Token::simpleMatch(vartok->next(), "<<")) {
|
||||||
// Is this calculation done in rhs?
|
// Is this calculation done in rhs?
|
||||||
const Token *tok = vartok;
|
const Token *tok = vartok;
|
||||||
while (Token::Match(tok, "%name%|.|::"))
|
while (Token::Match(tok, "%name%|.|::"))
|
||||||
|
@ -1022,8 +1022,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer, Alloc al
|
||||||
|
|
||||||
// Is variable a known POD type then this is a variable usage,
|
// Is variable a known POD type then this is a variable usage,
|
||||||
// otherwise we assume it's not.
|
// otherwise we assume it's not.
|
||||||
const Variable *var = vartok->variable();
|
return (vartok->valueType() && vartok->valueType()->isIntegral());
|
||||||
return (var && (var->typeStartToken()->isStandardType() || var->typeStartToken()->isEnumType()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alloc == NO_ALLOC && vartok->next() && vartok->next()->isOp() && !vartok->next()->isAssignmentOp())
|
if (alloc == NO_ALLOC && vartok->next() && vartok->next()->isOp() && !vartok->next()->isAssignmentOp())
|
||||||
|
|
Loading…
Reference in New Issue