================
@@ -542,12 +542,14 @@ til::SExpr *SExprBuilder::translateCallExpr(const 
CallExpr *CE,
                                             CallingContext *Ctx,
                                             const Expr *SelfE) {
   if (CapabilityExprMode) {
-    // Handle LOCK_RETURNED
-    if (const FunctionDecl *FD = CE->getDirectCallee()) {
-      FD = FD->getMostRecentDecl();
-      if (LockReturnedAttr *At = FD->getAttr<LockReturnedAttr>()) {
+    // Handle LOCK_RETURNED, on a function or a function pointer.
+    if (const auto *D = dyn_cast_or_null<NamedDecl>(CE->getCalleeDecl())) {
+      const auto *AttrD = D;
----------------
aaronpuchert wrote:

Here we would usually spell out the type, because the type is not apparent from 
the initializer.
```suggestion
      const NamedDecl *AttrD = D;
```

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

Reply via email to