Skip to content

Commit

Permalink
Update checkother.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Jan 3, 2025
1 parent dfce062 commit 7b17a1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,8 @@ static bool isConstStatement(const Token *tok, bool isNestedBracket = false)
}
return isConstStatement(tok->astOperand2(), /*isNestedBracket*/ !isChained);
}
if (!tok->astParent() && findLambdaEndToken(tok))
return true;
return false;
}

Expand Down Expand Up @@ -2184,6 +2186,8 @@ void CheckOther::constStatementError(const Token *tok, const std::string &type,
msg = "Redundant code: Found unused member access.";
else if (tok->str() == "[" && tok->tokType() == Token::Type::eExtendedOp)
msg = "Redundant code: Found unused array access.";
else if (tok->str() == "[" && !tok->astParent())
msg = "Redundant code: Found unused lambda.";
else if (mSettings->debugwarnings) {
reportError(tok, Severity::debug, "debug", "constStatementError not handled.");
return;
Expand Down

0 comments on commit 7b17a1d

Please sign in to comment.