Fix --check-library warning for int(i) (#4293)
This commit is contained in:
parent
c736fe8787
commit
5e537a666f
|
@ -268,7 +268,7 @@ static bool isLocalVarNoAutoDealloc(const Token *varTok, const bool isCpp)
|
|||
|
||||
static const Token * isFunctionCall(const Token * nameToken)
|
||||
{
|
||||
if (nameToken->isName()) {
|
||||
if (!nameToken->isStandardType() && nameToken->isName()) {
|
||||
nameToken = nameToken->next();
|
||||
// check if function is a template
|
||||
if (nameToken && nameToken->link() && nameToken->str() == "<") {
|
||||
|
|
|
@ -208,6 +208,7 @@ private:
|
|||
TEST_CASE(configuration2);
|
||||
TEST_CASE(configuration3);
|
||||
TEST_CASE(configuration4);
|
||||
TEST_CASE(configuration5);
|
||||
|
||||
TEST_CASE(ptrptr);
|
||||
|
||||
|
@ -2371,6 +2372,13 @@ private:
|
|||
ASSERT_EQUALS("[test.c:4]: (information) --check-library: Function set_data() should have <use>/<leak-ignore> configuration\n", errout.str());
|
||||
}
|
||||
|
||||
void configuration5() {
|
||||
check("void f() {\n"
|
||||
" int(i);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void ptrptr() {
|
||||
check("void f() {\n"
|
||||
" char **p = malloc(10);\n"
|
||||
|
|
Loading…
Reference in New Issue