[clang] [RFC] Initial implementation of P2719 (PR #113510)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 25 12:57:47 PDT 2025
================
@@ -3482,15 +3486,40 @@ bool FunctionDecl::isDestroyingOperatorDelete() const {
// Within a class C, a single object deallocation function with signature
// (T, std::destroying_delete_t, <more params>)
// is a destroying operator delete.
- if (!isa<CXXMethodDecl>(this) || getOverloadedOperator() != OO_Delete ||
- getNumParams() < 2)
+ if (!isa<CXXMethodDecl>(this) || getOverloadedOperator() != OO_Delete)
+ return false;
+
----------------
cor3ntin wrote:
> [@cor3ntin](https://github.com/cor3ntin) is it possible to convince C++ to allow new/delete to be a member function? (Otherwise I'm not sure how I can make a test that could ever hit this path)
Good point, NVM this comment then
<!-- Reviewable comment -OMDqhpX699Za4ZpuDiG:b-ddazod -->
<!-- Sent from Reviewable.io -->
https://github.com/llvm/llvm-project/pull/113510
More information about the cfe-commits
mailing list