[clang] [win][clang] Align scalar deleting destructors with MSABI (PR #139566)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 13 21:18:13 PDT 2025
================
@@ -2886,6 +2887,16 @@ class CXXDestructorDecl : public CXXMethodDecl {
return getCanonicalDecl()->OperatorDelete;
}
+ const FunctionDecl *getOperatorGlobalDelete() const {
+ return getCanonicalDecl()->OperatorGlobalDelete;
+ }
+
+ void setOperatorGlobalDelete(FunctionDecl *OD) {
----------------
tahonermann wrote:
Per [\[expr.delete\]p8](https://eel.is/c++draft/expr.delete#8), `OD` shall point to a [*usual deallocation function*](https://eel.is/c++draft/basic.stc.dynamic.deallocation#def:usual_deallocation_function). Can that be asserted somehow? I found `Sema::isUsualDeallocationFunction()` and `CXXMethodDecl::isUsualDeallocationFunction()`, but those only operate on `CXXMethodDecl` for some reason. It looks like `isNonPlacementDeallocationFunction()` in `clang/lib/Sema/SemaExprCXX.cpp` might be helpful, but it is declared `static`.
https://github.com/llvm/llvm-project/pull/139566
More information about the cfe-commits
mailing list