[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 08:57:26 PST 2024


================
@@ -2282,6 +2308,9 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
   const NamedDecl *D = walker.getDecl();
   CurrentFunction = dyn_cast<FunctionDecl>(D);
 
+  if (isa<FunctionDecl, ObjCMethodDecl>(D))
----------------
aaronpuchert wrote:

The way I understand this, `isa<FunctionDecl, ObjCMethodDecl>` checks if the argument is a `FunctionDecl` or `ObjCMethodDecl`, and that is always true. The `dyn_cast` is to `FunctionDecl` specifically.

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


More information about the cfe-commits mailing list