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

bugprone-use-after-move: Support configuration for custom container + pointer types #36901

Open
nelhage opened this issue May 22, 2018 · 0 comments
Labels
bugzilla Issues migrated from bugzilla clang-tidy

Comments

@nelhage
Copy link

nelhage commented May 22, 2018

Bugzilla Link 37553
Version unspecified
OS All

Extended Description

The documentation states that “reinitialization” occurs if [among others]:

  • clear() or assign() is called on the variable and the variable is of one of the standard container types basic_string, vector, deque, forward_list, list, set, map, multiset, multimap, unordered_set, unordered_map, unordered_multiset, unordered_multimap.

Please add a configuration option allowing users to specify additional custom container types with the same semantics. I'm programming against absl::InlineVector, and it is frustrating that .clear() on that type -- which in ~every other way behaves like std:vector -- does not satisfy this clang-tidy check.

Similar configuration for custom smart-pointer types and reset() would likely also make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy
Projects
None yet
Development

No branches or pull requests

1 participant