[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 17 10:00:15 PST 2025


vbvictor wrote:

@PiotrZSL, thank you for pointing out better naming pattern for diag-messages, would use it in the future.

1. Created new warning and fix-it messages.
2. Renamed check.
3. As for now, my check can support any type that will have `reset` method, this include `std::optional`. Maybe a more general approach would be to detect overlapping methods with classes that are returned via `operator*` and `operator->`. However, if some method is called on main object and there is no equivalent of `= nullptr` I don't know how user can fix such warning.

https://github.com/llvm/llvm-project/pull/121291


More information about the cfe-commits mailing list