Skip to content

Fix #11617 FP constParameter with std::begin/end#8427

Open
chrchr-github wants to merge 19 commits intodanmar:mainfrom
chrchr-github:chr_11617
Open

Fix #11617 FP constParameter with std::begin/end#8427
chrchr-github wants to merge 19 commits intodanmar:mainfrom
chrchr-github:chr_11617

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github chrchr-github marked this pull request as ready for review April 9, 2026 11:11
const Token* varTok = tok->astOperand2();
while (Token::simpleMatch(varTok, "["))
varTok = varTok->astOperand1();
if (Token::simpleMatch(varTok, "."))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest replace the if with while

varTok = varTok->astOperand1();
if (Token::simpleMatch(varTok, "."))
varTok = varTok->astOperand2();
const auto* const paramVariable = varTok->variable();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume varTok could become null here. personally I prefer the actual type Variable instead of auto when it's not super obvious i.e. cast result type..

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants