Skip to content

Commit ba0dca6

Browse files
committed
update invalidContainer check
1 parent 2d6f23e commit ba0dca6

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/checkstl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,7 @@ void CheckStl::invalidContainer()
11931193
if (info.tok->variable()->isReference() && !isVariableDecl(info.tok) &&
11941194
reaches(info.tok->variable()->nameToken(), tok, nullptr)) {
11951195

1196-
if ((assignExpr && Token::Match(assignExpr->astOperand1(), "& %varid%", info.tok->varId())) || // TODO: fix AST
1197-
Token::Match(assignExpr, "& %varid% {|(", info.tok->varId())) {
1196+
if ((assignExpr && Token::Match(assignExpr->astOperand1()->previous(), "& %varid%", info.tok->varId()))) {
11981197
return false;
11991198
}
12001199

0 commit comments

Comments
 (0)