[clang] [clang][Sema] Check swift_attr argument count in type contexts (PR #228873)

Ambrose Leeb via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 12:54:20 PDT 2026


https://github.com/Sirraide commented:

> Unlike declaration attributes, this path does not go through `checkCommonAttributeFeatures`

This seems very odd to me; I feel like we should just be calling that for type attributes as well.

I've had an LLM track down and examine the original review that introduced `checkCommonAttributeFeatures()` (https://reviews.llvm.org/D114439), and there doesn't seem to be a reason why types are excluded. That said, I haven't actually read through the entire review myself because it's... quite long.

If there is no reason, then I think the right fix would be to just call that function in the type attribute handling code before we ever get to the place where `swift_attr` is handled.

@erichkeane Do you happen to know if there's a reason why we don't call `checkCommonAttributeFeatures()` on type attributes?

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


More information about the cfe-commits mailing list