Skip to content

Fix #11469 FP mismatchingContainerExpression warning#5912

Merged
chrchr-github merged 1 commit into
cppcheck-opensource:mainfrom
chrchr-github:chr_Fix11469
Jan 30, 2024
Merged

Fix #11469 FP mismatchingContainerExpression warning#5912
chrchr-github merged 1 commit into
cppcheck-opensource:mainfrom
chrchr-github:chr_Fix11469

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/astutils.cpp
if (Token::simpleMatch(parent, "&"))
return true;
if (Token::simpleMatch(parent, "return") && parent->valueType()->reference != Reference::None &&
parent->valueType()->container && parent->valueType()->container->stdStringLike)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We used to treat any pointer as a temporary value.
This line is for const std::string& f() { return "abc"; }

@chrchr-github chrchr-github merged commit 06c8363 into cppcheck-opensource:main Jan 30, 2024
@chrchr-github chrchr-github deleted the chr_Fix11469 branch January 30, 2024 11:12
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.

1 participant