================
@@ -3054,6 +3054,13 @@ QualType ASTContext::removeAddrSpaceQualType(QualType T) 
const {
   if (!T.hasAddressSpace())
     return T;
 
+  // For arrays, strip the qualifier off the element type, then reconstruct the
+  // array type
+  if (T.getTypePtr()->isArrayType()) {
+    Qualifiers Qualfs;
+    return getUnqualifiedArrayType(T, Qualfs);
----------------
efriedma-quic wrote:

You need to preserve the non-address-space qualifiers, the same way the code 
after the loop does.  Actually, I'd just recommend restructuring to use the 
existing code, something like:

```
if (T.getTypePtr()->isArrayType()) {
  getUnqualifiedArrayType()
} else {
  while (T.hasAddressSpace()) {
     [...]
  }
}
```


https://github.com/llvm/llvm-project/pull/92612
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to