We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d6f23e commit ba0dca6Copy full SHA for ba0dca6
1 file changed
lib/checkstl.cpp
@@ -1193,8 +1193,7 @@ void CheckStl::invalidContainer()
1193
if (info.tok->variable()->isReference() && !isVariableDecl(info.tok) &&
1194
reaches(info.tok->variable()->nameToken(), tok, nullptr)) {
1195
1196
- if ((assignExpr && Token::Match(assignExpr->astOperand1(), "& %varid%", info.tok->varId())) || // TODO: fix AST
1197
- Token::Match(assignExpr, "& %varid% {|(", info.tok->varId())) {
+ if ((assignExpr && Token::Match(assignExpr->astOperand1()->previous(), "& %varid%", info.tok->varId()))) {
1198
return false;
1199
}
1200
0 commit comments