[clang] [clang][Sema] Function effect analysis was missing the implicit call to the destructor in a CXXDeleteExpr. (PR #184460)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 10:48:04 PDT 2026
================
@@ -1255,15 +1255,23 @@ class Analyzer {
}
bool VisitCXXDeleteExpr(CXXDeleteExpr *Delete) override {
+ FunctionDecl *OpDelete = Delete->getOperatorDelete();
+
+ // RecursiveASTVisitor does not visit the called destructor.
+ // But a destroying operator delete means that no destructor is called.
+ if (OpDelete == nullptr || !OpDelete->isDestroyingOperatorDelete()) {
----------------
Sirraide wrote:
Oh right; I was only looking at the body of the `if` statement and was like ‘we’re not using `OpDelete`, so why do we care whether it’s null’, but yes, you’re right, the condition uses it so we should keep that check
https://github.com/llvm/llvm-project/pull/184460
More information about the cfe-commits
mailing list