Skip to content

Fix #14812 FN useStlAlgorithm with std::set#8629

Open
chrchr-github wants to merge 5 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_14812
Open

Fix #14812 FN useStlAlgorithm with std::set#8629
chrchr-github wants to merge 5 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_14812

Conversation

@chrchr-github

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread gui/checkstatistics.cpp Outdated
for (const QString& tool: mPerformance.keys()) ret.insert(tool);
for (const QString& tool: mPortability.keys()) ret.insert(tool);
for (const QString& tool: mError.keys()) ret.insert(tool);
std::copy(mStyle.keys().begin(), mStyle.keys().end(), std::inserter(ret, ret.end()));

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.

QMap::keys() seems to return by value. So I fear the begin() and end() will be called on different objects?

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.

Godd catch, I have filed https://trac.cppcheck.net/ticket/14855 about detecting this.

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