[PATCH] D48419: [OpenCL] Fixed parsing of address spaces for C++

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 21 12:02:35 PDT 2018


Anastasia added a comment.

In https://reviews.llvm.org/D48419#1139601, @yaxunl wrote:

> Did you notice the bug that C++ silently allows implicit casting of a pointer to a pointer type with different address space?
>
> Do you have a fix for that?


I didn't think it did because if I run  `test/SemaOpenCL/address-spaces-conversions-cl2.0.cl` in `-cl-std=c++` it gives me errors when I initialize a pointer with different AS pointer:

  error: cannot initialize a variable of type '__global int *' with an lvalue of type '__local int *'
  error: assigning to '__global int *' from incompatible type '__local int *'
  error: comparison of distinct pointer types ('__global int *' and '__local int *')

Do you have an example code somewhere?


https://reviews.llvm.org/D48419





More information about the cfe-commits mailing list