Uninitialized variables: Fix false positives for '= { .. }'. Ticket: #3369
This commit is contained in:
parent
3153650be3
commit
e723ef0569
|
@ -1123,6 +1123,10 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const unsigned int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip = { .. }
|
||||||
|
if (Token::simpleMatch(tok, "= {"))
|
||||||
|
tok = tok->next()->link();
|
||||||
|
|
||||||
// TODO: handle loops, try, etc
|
// TODO: handle loops, try, etc
|
||||||
if (tok->str() == "for" || Token::simpleMatch(tok, ") {") || Token::Match(tok, "%var% {")) {
|
if (tok->str() == "for" || Token::simpleMatch(tok, ") {") || Token::Match(tok, "%var% {")) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue