There was an error while loading. Please reload this page.
1 parent 72a9b13 commit 4f3a25dCopy full SHA for 4f3a25d
1 file changed
lib/checkleakautovar.cpp
@@ -291,10 +291,11 @@ static const Token * isAnonymousFunctionCall(const Token * tok)
291
// the lpar surrounding x has isCast() == true, so checking isCast() would
292
// have false positive leaks, while allowing casts to take ownership of
293
// resources is instead a false negative
294
- if (tok->previous()->str() == "(" && !tok->previous()->isBinaryOp() &&
+ if (tok->strAt(-1) == "(" && !tok->previous()->isBinaryOp() &&
295
tok->linkAt(-1) && !tok->isStandardType()) {
296
tok = tok->linkAt(-1)->next();
297
- } else if (!tok->isStandardType() && tok->isName() && tok->next()->str() == "(") {
+ } else if (!tok->isStandardType() && tok->isName() &&
298
+ tok->strAt(1) == "(") {
299
tok = tok->linkAt(1)->next();
300
} else {
301
return nullptr;
0 commit comments