[Development] parented_ptr
Mathias Hasselmann
mathias at taschenorakel.de
Fri Oct 17 21:19:09 CEST 2025
Hi,
Am 16.10.25 um 12:22 schrieb Igor Khanin:
> I'm also not sure that a smart pointer wrapper type brings a lot of value
It's a similar kind of bread as gsl::owner<T> [1], which can help static
analyzers to make correct assumptions about memory usage [2].
Just that I am not sure, if this very type really helps tools like
clang-tidy to reduce false positives about memory leaks.
In my experience one currently cannot use truly useful clang-tidy checks
like cplusplus.NewDeleteLeaks [3] with Qt code as clang-tidy tends to
report a huge amount of false leaks with Qt code.
I do no know enough to judge, if parent_ptr<T> is the solution we want
to use, but it would be really nice if one could use checks like
cplusplus.NewDeleteLeaks with Qt.
Ciao
Mathias
[1]:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#gslowner-ownership-pointers
[2]:
https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/owning-memory.html
[3]:
https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer/cplusplus.NewDeleteLeaks.html
More information about the Development
mailing list