[PATCH] D53764: [OpenCL] Enable address spaces for references in C++

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 13 09:58:31 PST 2018


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaExprCXX.cpp:4289
+                             /*BasePath=*/nullptr, CCK)
+               .get();
 
----------------
Anastasia wrote:
> rjmccall wrote:
> > Okay.  But if `ToType` *isn't* a reference type, this will never be an address-space conversion.  I feel like this code could be written more clearly to express what it's trying to do.
> I hope it makes more sense now. Btw, it also applies to pointer type.
The logic is wrong for pointer types; if you're converting pointers, you need to be checking the address space of the pointee type of the from type.

It sounds like this is totally inadequately tested; please flesh out the test with all of these cases.  While you're at it, please ensure that there are tests verifying that we don't allowing address-space changes in nested positions.


https://reviews.llvm.org/D53764





More information about the cfe-commits mailing list