Skip to content

[clang-tidy] Add ReinitializationFunctions option to bugprone-use-after-move #170635

@zeyi2

Description

@zeyi2

Recently, this PR introduces the InvalidationFunctions option to bugprone-use-after-move check , which allows users to specify custom functions that invalidate an object.

Currently, the check only recognizes reinitialization via Assignment (operator=), library functions (std::vector::clear, std::unique_ptr::reset) and functions annotated with [[clang::reinitializes]].

It would be beneficial to add a ReinitializationFunctions option, which allows users to specify methods that effectively re-initialize a moved-from object.

This option will be useful when dealing with third-party libraries/legacy codebase where mass updating [[clang::reinitializes]] attribute is not feasible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions