Fixed #914 (improve check: usage of uninitialized variable)
This commit is contained in:
parent
1204043556
commit
e523d5a3a3
|
@ -991,6 +991,12 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
if (Token::Match(tok2, "const %type% %var% [ ] ,|)") && tok2->next()->isStandardType())
|
||||
{
|
||||
tok2 = tok2->tokAt(5);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1131,6 +1131,8 @@ private:
|
|||
ASSERT_EQUALS("foo", analyseFunctions("void foo(int x);"));
|
||||
ASSERT_EQUALS("foo", analyseFunctions("void foo(const int &x) { }"));
|
||||
ASSERT_EQUALS("foo", analyseFunctions("void foo(int &x) { ++x; }"));
|
||||
ASSERT_EQUALS("rename", analyseFunctions("int rename (const char* oldname, const char* newname);"));
|
||||
ASSERT_EQUALS("rename", analyseFunctions("int rename (const char oldname[], const char newname[]);"));
|
||||
ASSERT_EQUALS("", analyseFunctions("void foo(int &x) { x = 0; }"));
|
||||
ASSERT_EQUALS("", analyseFunctions("void foo(s x) { }"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue