[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

Daan De Meyer via cfe-commits cfe-commits at lists.llvm.org
Mon May 19 12:26:40 PDT 2025


================
@@ -1351,7 +1352,8 @@ def OSConsumesThis : InheritableAttr {
 
 def Cleanup : InheritableAttr {
   let Spellings = [GCC<"cleanup">];
-  let Args = [DeclArgument<Function, "FunctionDecl">];
+  let Args = [DeclArgument<Function, "FunctionDecl">,
+              ExprArgument<"Expr", /*opt=*/0, /*fake=*/1>];
----------------
DaanDeMeyer wrote:

For 1) in handleCleanupAttr there's code to handle the case where the expr is not a declrefexpr. How does that work with passing in a DeclRefExpr to DeclArgument?

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


More information about the cfe-commits mailing list