[clang] [Clang][NFC] Refactor operator delete argument handling (PR #160554)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 11:54:41 PDT 2025


================
@@ -2646,6 +2647,8 @@ class FunctionDecl : public DeclaratorDecl,
   bool isTypeAwareOperatorNewOrDelete() const;
   void setIsTypeAwareOperatorNewOrDelete(bool IsTypeAwareOperator = true);
 
+  UsualDeleteParams getUsualDeleteParams() const;
----------------
ojhunt wrote:

@kees is it reasonable to have this here but the struct definition be in a separate header? Moving the definition to Decl.h, requires a bunch of other related definitions to be moved - I think it would be reasonable to do so if we're going to make this present directly in Decl?

@andykaylor I think this should be an optional return - e.g. `std::optional<UsualDeleteParams>` or we could smooth out the declaration w/o the definition with `bool getUsualDeleteParams(UsualDeleteParams *) const`. I'd prefer `optional<UsualDeleteParams>` given the alternation of `true` and `false` meaning success or fail in different places.

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


More information about the cfe-commits mailing list