[clang] [clang] Instantiate attributes on other decl types (PR #115924)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 15:04:36 PST 2024


erichkeane wrote:

> > The change is reasonable, but I need to see tests for each of the types.
> > In general, we've had the attitude of "we can enable this instantiation once we see examples of it being useful", so we need tests to make sure it is instantiated, AND that it is useful.
> 
> This makes a lot of sense... but I'm not sure there's currently a way to write a FileCheck test for (e.g.) attributes on labels, which is actually my motivating case here. It'd be a pretty big change to start dumping label attributes in text AST dumps when the LabelDecl isn't even shown. Any suggestions?

the others make sense for it.

`LabelDecl` is an interesting beast, and it actually is a little awkward that `LabelDecl` can have attributes, since it is actually the statement that has them written on it.  IMO, we should have it ast-dump the attributes for the `LabelStmt`, and it should just print the ones from the `Decl`.  It isn't really possible AFAIK to have an 'implicit' `LabelDecl` have attributes anyway, so it makes sense to print them there.



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


More information about the cfe-commits mailing list