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

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 10 00:10:06 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>


tbaederr wrote:

> > This was much easier than expected actually.
> 
> Making it a `DeclOrType` attribute is indeed a nice idea, this would allow existing attributes to stay where they are. Is it still inheritable, i.e. does it also apply to later redeclarations?

I haven't tested this explicitly, but `DeclOrTypeAttr` is-a `InheritableAttr`:
https://github.com/llvm/llvm-project/blob/5dd9266c4e0b0a02cbb02a29bf2606224ccf2820/clang/include/clang/Basic/Attr.td#L644-L647C1

> Of course I'm also wondering why we don't have to change anything in the analysis, aren't we currently only looking at declaration attributes, and wouldn't consider attributes on the type? Or is there some mechanism that gives us the combined set of declaration and type attributes?

Let me check why this just works.

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


More information about the cfe-commits mailing list