Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Jan 5, 2025
1 parent 4793d2a commit a50f7b0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/checkunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,14 +1536,10 @@ void CheckUnusedVar::checkStructMemberUsage()

// Bailout if struct is used in structured binding
for (const Variable *var : symbolDatabase->variableList()) {
if (!var || !Token::simpleMatch(var->typeStartToken(), "auto"))
if (!var || !Token::Match(var->typeStartToken(), "auto &|&&| [ %varid%", var->declarationId()))
continue;

const Token *tok = var->nameToken()->previous();
if (!Token::simpleMatch(tok, "["))
continue;

tok = tok->link();
const Token *tok = var->nameToken()->previous()->link();
if (!Token::Match(tok, "] %assign%"))
continue;

Expand Down

0 comments on commit a50f7b0

Please sign in to comment.