[clang] [WebKit Checkers] Trivial analysis should check destructors of function parameters and local variables (PR #181576)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 16 15:32:30 PST 2026
================
@@ -87,7 +87,6 @@ class SomeClass {
}
void [[clang::annotate_type("webkit.nodelete")]] swapObj(RefPtr<RefCountable>&& obj) {
- // expected-warning at -1{{A function 'swapObj' has [[clang::annotate_type("webkit.nodelete")]] but it contains code that could destruct an object}}
m_obj.swap(obj);
}
----------------
rniwa wrote:
This is a rather confusing case but I think we treat `swap` as trivial in this case because it's just doing a bunch of pointer manipulations. Assignment of pointer member variables, etc... are trivial so long as we don't generate a code to call `deref()` with `delete this` in it with a non-trivial destructor.
https://github.com/llvm/llvm-project/pull/181576
More information about the cfe-commits
mailing list