Skip to content

Fix #14919: FP constVariableReference (initialization with parentheses)#8731

Merged
ludviggunne merged 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14919-paren-init
Jul 16, 2026
Merged

Fix #14919: FP constVariableReference (initialization with parentheses)#8731
ludviggunne merged 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14919-paren-init

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

@ludviggunne ludviggunne merged commit bc9349a into cppcheck-opensource:main Jul 16, 2026
70 checks passed
@ludviggunne ludviggunne deleted the 14919-paren-init branch July 16, 2026 08:59
Comment thread lib/astutils.cpp
if (!start)
return false;
if (Token::Match(start, "; %varid% =", var->declarationId()))
if (Token::Match(start, "; %varid% =", var->declarationId()) && !Token::simpleMatch(start->previous(), ")"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe it would be clearer to check for start->isSplittedVarDeclComma().

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