================
@@ -6346,9 +6346,20 @@ namespace {
static void
fillDependentAddressSpaceTypeLoc(DependentAddressSpaceTypeLoc DASTL,
- const ParsedAttributesView &Attrs) {
- for (const ParsedAttr &AL : Attrs) {
- if (AL.getKind() == ParsedAttr::AT_AddressSpace) {
+ const Declarator &D,
+ const DeclaratorChunk &Chunk) {
+ // An attribute written after the declarator-id appertains to the declared
+ // entity and is applied to the outermost type rather than to a chunk, so
+ // every attribute list of the declarator has to be searched.
+ const ParsedAttributesView *AttrLists[] = {
+ &Chunk.getAttrs(), &D.getAttributes(), &D.getDeclSpec().getAttributes(),
+ &D.getDeclarationAttributes()};
+ for (const ParsedAttributesView *Attrs : AttrLists) {
+ for (const ParsedAttr &AL : *Attrs) {
----------------
TPPPP72 wrote:
Why not pass `const ParsedAttributesView *AttrLists[]`
https://github.com/llvm/llvm-project/pull/216348
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits