Issue 170635
Summary [clang-tidy] Add `ReinitializationFunctions` option to `bugprone-use-after-move`
Labels clang-tidy
Assignees
Reporter zeyi2
    Recently, [this PR](https://github.com/llvm/llvm-project/pull/170346) 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.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to