================ @@ -1206,15 +1206,16 @@ CanThrowResult Sema::canThrow(const Stmt *S) { CT = CT_Dependent; } else { const FunctionDecl *OperatorDelete = DE->getOperatorDelete(); - CT = canCalleeThrow(*this, DE, OperatorDelete); - if (const RecordType *RT = DTy->getAs<RecordType>()) { - const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl()); - const CXXDestructorDecl *DD = RD->getDestructor(); - if (DD && !OperatorDelete->isDestroyingOperatorDelete()) + if (!OperatorDelete->isDestroyingOperatorDelete()) { + CT = canCalleeThrow(*this, DE, OperatorDelete); ---------------- zygoloid wrote:
```suggestion CT = canCalleeThrow(*this, DE, OperatorDelete); if (!OperatorDelete->isDestroyingOperatorDelete()) { ``` A destroying operator delete itself can still throw, I think. https://github.com/llvm/llvm-project/pull/118687 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits