Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67095/cl...@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;
----------------
AaronBallman wrote:

Er, not certain I agree that should be a separate change -- I don't see 
*anything* hooking this up as a type attribute beyond the change to 
`DeclOrTypeAttr` in `Attr.td`. Declaration attributes have a ton of 
tablegenerated code that hooks things up for them, but type attributes are 
special and require more involved manual work.

I would have expected to see changes [in 
here](https://github.com/llvm/llvm-project/blob/28b7e281d4eaea0d5d56b1a4cf7a550be746a007/clang/lib/Sema/SemaType.cpp#L8615)
 to hook this up with the type system. Once the type is wrapped in an 
attribute, the diagnostic behavior you're looking for should come along "for 
free".

https://github.com/llvm/llvm-project/pull/67095
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to