[clang] [RFC] Initial implementation of P2719 (PR #113510)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 6 01:38:35 PST 2024
================
@@ -3482,15 +3486,40 @@ bool FunctionDecl::isDestroyingOperatorDelete() const {
// Within a class C, a single object deallocation function with signature
// (T, std::destroying_delete_t, <more params>)
// is a destroying operator delete.
- if (!isa<CXXMethodDecl>(this) || getOverloadedOperator() != OO_Delete ||
- getNumParams() < 2)
+ if (!isa<CXXMethodDecl>(this) || getOverloadedOperator() != OO_Delete)
+ return false;
+
+ unsigned NumParams = getNumParams();
+ unsigned DestroyingDeleteTagParam = 1;
+ bool IsTypeAware = false;
+ if (NumParams > 0)
+ IsTypeAware = getParamDecl(0)->getType()->isTypeIdentitySpecialization();
----------------
cor3ntin wrote:
There is some duplication with Sema::isTypeAwareOperatorNewOrDelete, can we simplify?
https://github.com/llvm/llvm-project/pull/113510
More information about the cfe-commits
mailing list