Skip to content

Commit 1a7259a

Browse files
Update checkleakautovar.cpp
1 parent e4a8480 commit 1a7259a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkleakautovar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ bool CheckLeakAutoVar::checkScope(const Token * const startToken,
444444
if (tok2->str() == ";") {
445445
break;
446446
}
447-
if (tok2->varId()) {
447+
if (tok2->varId() && !Token::Match(tok2->astParent(), "%comp%|!")) {
448448
varInfo.erase(tok2->varId());
449449
}
450450
}

0 commit comments

Comments
 (0)