Skip to content

fixed some modernize-use-emplace false negatives and some bugprone-assignment-in-if-condition warnings#4311

Merged
danmar merged 3 commits intocppcheck-opensource:mainfrom
firewave:tidy-emplace-fn
Jul 28, 2022
Merged

fixed some modernize-use-emplace false negatives and some bugprone-assignment-in-if-condition warnings#4311
danmar merged 3 commits intocppcheck-opensource:mainfrom
firewave:tidy-emplace-fn

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

We are not interested in bugprone-assignment-in-if-condition as it's something we use intentionally. I did fix two cases where it was unnecessary though.
We also encountered two false positives with it. The first one is filed as llvm/llvm-project#56729.

The modernize-use-emplace false negatives already have upstream tickets:
llvm/llvm-project#56721
llvm/llvm-project#55870
llvm/llvm-project#55869
llvm/llvm-project#55856

Comment thread lib/symboldatabase.cpp
if (type)
return type;
else if ((scope1 = scope->findRecordInBase(tok->str()))) {
else if (const Scope *scope1 = scope->findRecordInBase(tok->str())) {
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.

This is probably something which would fall under "scope reduction". I will file a ticket about this.

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.

@danmar danmar merged commit efaaa58 into cppcheck-opensource:main Jul 28, 2022
@firewave firewave deleted the tidy-emplace-fn branch July 28, 2022 21:28
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