[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 8 14:50:52 PDT 2023


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67095/clang at github.com>


================
@@ -136,6 +136,17 @@ int main(void) {
     // Cleanup happens automatically -> no warning.
   }
 
+  /// Function pointers
+  {
+    int __attribute__((requires_capability(&mu1))) (*function_ptr)(int) = Foo_fun1;
----------------
aaronpuchert wrote:

Right, we would likely want to catch function pointer conversions that drop the attribute. But this should be a separate change.

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


More information about the cfe-commits mailing list