================
@@ -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) {
+      // Invalid or malformed attributes never produce a type.
+      if (AL.getKind() != ParsedAttr::AT_AddressSpace || AL.isInvalid() ||
+          AL.getNumArgs() != 1 || !AL.isArgExpr(0))
+        continue;
----------------
TPPPP72 wrote:

What's the meaning here?

https://github.com/llvm/llvm-project/pull/216348
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to