[clang] [WebKit Checkers] Trivial analysis should check destructors of function parameters and local variables (PR #181576)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 16 14:39:04 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);
}
----------------
steakhal wrote:
So this (`swapObj`) is a CXXMethodDecl, of a CXXRecordDecl that has a FieldDecl called `m_obj` that has a non-trivial dtor (because it is of type `RefPtr<RefCountable>` and the function
`RefPtr<RefCountable>::swap` is gotta be non-trivial, right?
so the tldr to me is that we called a non-trivial `swap` here while this method is `nodelete` attributed.
Something is wrong here.
https://github.com/llvm/llvm-project/pull/181576
More information about the cfe-commits
mailing list