Anastasia added inline comments.
================ Comment at: lib/Sema/SemaCast.cpp:2283 + const QualType &SrcType, + const QualType &DestType) { + // OpenCL v1 s6.5: Casting a pointer to address space A to a pointer to ---------------- rjmccall wrote: > Why is this not a method on `CastOperation`? Will change! ================ Comment at: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { + const PointerType *DestPtr = DestType->getAs<PointerType>(); + if (!DestPtr->isAddressSpaceOverlapping(*SrcType->getAs<PointerType>())) { ---------------- rjmccall wrote: > Please test the result of `getAs` instead of separately testing > `isPointerType`. > > Why is this check OpenCL-specific? Address spaces are a general language > feature. I think mainly because I am factoring out from the existing OpenCL check. But it probably makes sense that the semantics of this is not different in other languages. I will update it! Thanks! https://reviews.llvm.org/D52598 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits