Skip to content

Fix #14894: false positive: co_return not recognized as return in combination with {} #8741

Open
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14894-co_return-braces
Open

Fix #14894: false positive: co_return not recognized as return in combination with {} #8741
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14894-co_return-braces

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/forwardanalyzer.cpp
if (out)
*out = loopEnds.back();
} else if (Token::Match(tok, "return|throw")) {
} else if (Token::Match(tok, "return|co_return|throw")) {

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.

This will probably crop up in multiple places, so we might want to add a helper function, which should also check language and standard.

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.

2 participants