================ @@ -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); ---------------- changpeng wrote:
Thanks. Can I do as the following? Note that I am passing QualifierCollector to getUnqualifiedArrayType, which has Qualifiers as the second argument. Also, TypeNode = T.getTypePtr(); after I is unqualified. QualifierCollector Quals; const Type *TypeNode; if (T.getTypePtr()->isArrayType()) { T = getUnqualifiedArrayType(T, Quals); TypeNode = T.getTypePtr(); } 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