================ @@ -2533,11 +2533,34 @@ bool CXXMethodDecl::isUsualDeallocationFunction( getOverloadedOperator() != OO_Array_Delete) return false; + bool IsTypeAware = isTypeAwareOperatorNewOrDelete(); + // C++ [basic.stc.dynamic.deallocation]p2: + // Pre-type aware allocators: // A template instance is never a usual deallocation function, // regardless of its signature. - if (getPrimaryTemplate()) - return false; + // Pending final C++26 text: + // A template instance is only a usual deallocation function if it + // is a type aware deallocation function, and only the type-identity + // parameter is dependent. + if (FunctionTemplateDecl *PrimaryTemplate = getPrimaryTemplate()) { + if (!IsTypeAware) { + // Stop early on if the specialization is not explicitly type aware + return false; + } ---------------- cor3ntin wrote:
```suggestion if (!IsTypeAware) // Stop early on if the specialization is not explicitly type aware return false; ``` https://github.com/llvm/llvm-project/pull/113510 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits