[clang] [RFC] Initial implementation of P2719 (PR #113510)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 1 22:48:34 PDT 2025


================
@@ -2474,19 +2474,46 @@ bool CXXMethodDecl::isUsualDeallocationFunction(
       getOverloadedOperator() != OO_Array_Delete)
     return false;
 
+  auto NumParams = getNumParams();
+  bool IsTypeAware = IsTypeAwareOperatorNewOrDelete();
+
   // C++ [basic.stc.dynamic.deallocation]p2:
   //   A template instance is never a usual deallocation function,
   //   regardless of its signature.
-  if (getPrimaryTemplate())
-    return false;
+  if (auto *PrimaryTemplate = getPrimaryTemplate()) {
----------------
ojhunt wrote:

Done.
<!-- Reviewable comment -OMoykFX1j7b6tOUI9i_:b-896fix -->
<!-- Sent from Reviewable.io -->


https://github.com/llvm/llvm-project/pull/113510


More information about the cfe-commits mailing list