[clang] Thread Safety Analysis: Don't treat function pointer parameters as scoped capabilities (PR #211885)
Marco Elver via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 28 03:11:54 PDT 2026
================
@@ -533,14 +534,33 @@ void test(Ops *ops) {
}
```
-Note that the attributes are on the *variable* (or field), not on the function
-pointer type. Assigning a function with different (or no) attributes to an
-annotated function pointer variable is not diagnosed. The analysis trusts the
-annotations on the variable at the call site.
+On a parameter, the attributes describe the function reached through the
----------------
melver wrote:
I think this new paragraph is superfluous and more confusing than helpful and doesn't add much value. It already says above the attributes can apply to FP parameters, and the intuitive behaviour applies.
https://github.com/llvm/llvm-project/pull/211885
More information about the cfe-commits
mailing list