[Sema] Iteratively strip sugar when removing address spaces.
ASTContext::removeAddrSpaceQualType does not properly deal with sugar. QualTypes derive their ASes from the AS on the canonical type, not the type itself. However, removeAddrSpaceQualType only strips the outermost qualifiers, which means that it can fail to remove addrspace qualifiers if there is sugar in the way. Change the function to desugar types until the address space really no longer exists on the corresponding QualType. This should guarantee the removal of the address space. This fixes the erroneous behavior in D62574. Reviewed By: rjmccall, svenvh Differential Revision: https://reviews.llvm.org/D83325
Loading
Please sign in to comment