Skip to content

Fix #14744: Invalid AST for braced init and references/pointers#8549

Open
ludviggunne wants to merge 4 commits into
cppcheck-opensource:mainfrom
ludviggunne:14744
Open

Fix #14744: Invalid AST for braced init and references/pointers#8549
ludviggunne wants to merge 4 commits into
cppcheck-opensource:mainfrom
ludviggunne:14744

Conversation

@ludviggunne
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testtokenize.cpp Outdated
Comment thread test/testtokenize.cpp Outdated
Comment thread lib/tokenlist.cpp
typetok = typetok->next();
}
if (Token::Match(typetok, "%var% =") && typetok->varId())
if ((Token::Match(typetok, "%var% =") || Token::Match(typetok, "%var% {")) && typetok->varId())
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.

Suggested change
if ((Token::Match(typetok, "%var% =") || Token::Match(typetok, "%var% {")) && typetok->varId())
if (Token::Match(typetok, "%var% [={]") && typetok->varId())

And the && typetok->varId() is redundant, right?

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