Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -5293,7 +5293,9 @@ if (!Context.hasSameType(From->getType(), DestType)) { CastKind CK; - if (FromRecordType.getAddressSpace() != DestType.getAddressSpace()) + auto Ptee = DestType->getPointeeType(); + auto DestAS = Ptee.isNull() ? DestType.getAddressSpace() : Ptee.getAddressSpace(); + if (FromRecordType.getAddressSpace() != DestAS) CK = CK_AddressSpaceConversion; else CK = CK_NoOp;