================
@@ -559,9 +559,15 @@ static PathDiagnosticLocation getLocationForCaller(const 
StackFrame *SF,
     return PathDiagnosticLocation::createEnd(Dtor.getBindTemporaryExpr(), SM,
                                              CallerSF);
   }
+  case CFGElement::CleanupFunction: {
+    const CFGCleanupFunction &Cleanup = Source.castAs<CFGCleanupFunction>();
+    // The implicit call is not written in the source; anchor it at the
+    // function name in the cleanup attribute.
+    const CleanupAttr *A = Cleanup.getVarDecl()->getAttr<CleanupAttr>();
+    return PathDiagnosticLocation(A->getLoc(), SM);
----------------
necto wrote:

is it the function-name location or the attribute construct location?
Either way, a test that puts them on different lines would be helpful to know 
which one it is
```
    int x
       __attribute__
      ((cleanup(noop_cleanup)));
```

https://github.com/llvm/llvm-project/pull/221110
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to