[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>


================
@@ -8141,6 +8141,16 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
   if (!AL.checkAtLeastNumArgs(S, 1))
     return;
 
+  // We allow this on function declaration as well as
+  // variable declarations of function pointer type.
+  if (!D->isFunctionPointerType() && !isa<FunctionDecl>(D)) {
----------------
aaronpuchert wrote:

This looks like the attribute sits on the `Decl` and not its type, or am I misunderstanding this?

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


More information about the cfe-commits mailing list