Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy bugprone-use-after-move #33557

Merged

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

More static analysis.

This check looks for uses of objects after they have been moved from.

Describe the solution

Enable the clang-tidy check bugprone-use-after-move and fix related issues.

Most were suppressions of things in the tests that were deliberately testing move constructor semantics.

One was a genuine (latent) bug.

Also fixed a readability-inconsistent-declaration-parameter-name that has snuck onto master.

Describe alternatives you've considered

Could have just removed the std::move in the one buggy case. I don't think it's actually being moved in any case.

Additional context

36 more checks to triage after this.

Enable this clang-tidy check and deal with associated warnings.

Mostly these were suppressions for things in the tests that are
specifically testing move constructor semantics, but one case was a
genuine latent bug.
This error seems to have crept into master.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Aug 26, 2019
@ZhilkinSerg ZhilkinSerg merged commit 19f0f67 into CleverRaven:master Aug 26, 2019
@jbytheway jbytheway deleted the clang_tidy_bugprone_use_after_move branch August 28, 2019 22:15
misterprimus pushed a commit to misterprimus/Cataclysm-DDA that referenced this pull request Sep 21, 2019
* Enable bugprone-use-after-move

Enable this clang-tidy check and deal with associated warnings.

Mostly these were suppressions for things in the tests that are
specifically testing move constructor semantics, but one case was a
genuine latent bug.

* Fix mismatched declaration name

This error seems to have crept into master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants