diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index 3ba2da1a569..36f2e6e0d39 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -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() == "<") { diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index cd46b070bf7..5863a9f0d03 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -207,6 +207,7 @@ class TestLeakAutoVar : public TestFixture { TEST_CASE(configuration2); TEST_CASE(configuration3); TEST_CASE(configuration4); + TEST_CASE(configuration5); TEST_CASE(ptrptr); @@ -2356,6 +2357,13 @@ class TestLeakAutoVar : public TestFixture { ASSERT_EQUALS("[test.c:4]: (information) --check-library: Function set_data() should have / 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"