Index: clang/lib/Analysis/ThreadSafety.cpp =================================================================== --- clang/lib/Analysis/ThreadSafety.cpp +++ clang/lib/Analysis/ThreadSafety.cpp @@ -2063,8 +2063,21 @@ examineArguments(Exp->getDirectCallee(), Exp->arg_begin(), Exp->arg_end()); } - auto *D = dyn_cast_or_null(Exp->getCalleeDecl()); - if(!D || !D->hasAttrs()) + const auto *CD = Exp->getCalleeDecl(); + if (!CD) + return; + + const auto *D = dyn_cast(CD); + // For function pointers, try to get the currently known + // value of the pointer. + if (const auto *VD = dyn_cast(CD)) { + if (const Expr *E = Analyzer->LocalVarMap.lookupExpr(D, LVarCtx)) { + if (const auto *DRE = dyn_cast(E->IgnoreParenImpCasts())) + D = DRE->getDecl(); + } + } + + if (!D->hasAttrs()) return; handleCall(Exp, D); }