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

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 15:04:41 PDT 2025


================
@@ -477,6 +477,34 @@ class DeclarationName {
     return OO_None;
   }
 
+  bool isAnyOperatorNew() const {
+    if (getNameKind() != DeclarationName::CXXOperatorName)
+      return false;
+    switch (getCXXOverloadedOperator()) {
+    case OO_New:
+    case OO_Array_New:
+      return true;
+    default:
+      return false;
+    }
+  }
+
+  bool isAnyOperatorDelete() const {
----------------
ojhunt wrote:

@cor3ntin are you ok with this rename? I realized isOperatorDelete() (or New, etc) created a hazard where it was tempting to replace `==OO_Delete` with `isOperatorDelete()` which would be incorrect

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


More information about the cfe-commits mailing list