[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 17:16:40 PST 2025


================
@@ -2855,6 +2855,11 @@ class CXXDestructorDecl : public CXXMethodDecl {
     return getCanonicalDecl()->OperatorDeleteThisArg;
   }
 
+  /// Will this destructor ever be called when considering which deallocation
+  /// function is associated with the destructor? Can optionally be passed an
+  /// 'operator delete' function declaration to test against specifically.
+  bool isDestructorCalled(const FunctionDecl *OpDel = nullptr) const;
----------------
zygoloid wrote:

For readability of call sites, the name of this function should probably mention `delete` in some way. (`isCalledByDelete` maybe?)

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


More information about the cfe-commits mailing list