This commit is contained in:
parent
c340b6ae6c
commit
304e448749
|
@ -644,8 +644,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function call..
|
// Function call..
|
||||||
else if (isFunctionCall(ftok)) {
|
else if (const Token* openingPar = isFunctionCall(ftok)) {
|
||||||
const Token * openingPar = isFunctionCall(ftok);
|
|
||||||
const Library::AllocFunc* af = mSettings->library.getDeallocFuncInfo(ftok);
|
const Library::AllocFunc* af = mSettings->library.getDeallocFuncInfo(ftok);
|
||||||
VarInfo::AllocInfo allocation(af ? af->groupId : 0, VarInfo::DEALLOC, ftok);
|
VarInfo::AllocInfo allocation(af ? af->groupId : 0, VarInfo::DEALLOC, ftok);
|
||||||
if (allocation.type == 0)
|
if (allocation.type == 0)
|
||||||
|
@ -658,7 +657,9 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
|
||||||
|
|
||||||
// Handle scopes that might be noreturn
|
// Handle scopes that might be noreturn
|
||||||
if (allocation.status == VarInfo::NOALLOC && Token::simpleMatch(tok, ") ; }")) {
|
if (allocation.status == VarInfo::NOALLOC && Token::simpleMatch(tok, ") ; }")) {
|
||||||
const std::string functionName(mSettings->library.getFunctionName(tok->link()->previous()));
|
if (ftok->isKeyword())
|
||||||
|
continue;
|
||||||
|
const std::string functionName(mSettings->library.getFunctionName(ftok));
|
||||||
bool unknown = false;
|
bool unknown = false;
|
||||||
if (mTokenizer->isScopeNoReturn(tok->tokAt(2), &unknown)) {
|
if (mTokenizer->isScopeNoReturn(tok->tokAt(2), &unknown)) {
|
||||||
if (!unknown)
|
if (!unknown)
|
||||||
|
|
|
@ -2401,6 +2401,11 @@ private:
|
||||||
" int(i);\n"
|
" int(i);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("void f() {\n"
|
||||||
|
" static_assert(1 == sizeof(char), \"test\");\n"
|
||||||
|
"}\n", /*cpp*/ true);
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ptrptr() {
|
void ptrptr() {
|
||||||
|
|
Loading…
Reference in New Issue