================
@@ -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:
Hmm, I suppose it can be null. In that case, what this means is that we call
`followTypeDtor()` if it is not a destroying delete, or if the operator delete
is null, but then that means that if it _is_ a destroying delete _and_ the
operator is null, then we _do_ call `followTypeDtor()`... which doesn’t seem
right, though also I’m not sure that’s possible. Regardless, I feel like we
should change the condition from `OpDelete == nullptr ||
!OpDelete->isDestroyingOperatorDelete()` to just
`!OpDelete->isDestroyingOperatorDelete()`.
https://github.com/llvm/llvm-project/pull/184460
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits