[PATCH] D49294: Sema: Fix explicit address space cast in C++

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 18 09:07:32 PDT 2018


yaxunl added inline comments.


================
Comment at: lib/Sema/SemaOverload.cpp:3150
+      !getLangOpts().OpenCLCPlusPlus)
+    return false;
+
----------------
rjmccall wrote:
> It's not really OpenCL C++ that's special here, it's the possibility of promotions between address spaces.
For OpenCL C++, there is language rule about address space promotion.

For other languages, there is no generic rule about adderss space promotion, since the meaning of address space and their relations are target dependent. Do we want to introduce a target hook Target::canPromote(AddressSpace Src, AddressSpace Dest, LanguageOptions LangOpts) to represent this? Or do we just assume a simple rule, that is, all address space can be promoted to default address space 0, otherwise it is not allowed?


https://reviews.llvm.org/D49294





More information about the cfe-commits mailing list