[PATCH] D16682: 19957 - OpenCL incorrectly accepts implicit address space conversion with ternary operator

Igor Chesnokov via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 7 06:00:40 PST 2016


ichesnokov added inline comments.

================
Comment at: test/SemaOpenCL/ternary-implicit-casts.cl:10-11
@@ +9,4 @@
+kernel void implicit_cast_generic(global int* gint, local int* lint, int cond) {
+	// will compile, ptr is generic and can accept global and local
+	int* ptr = cond ? gint : lint; // expected-warning {{pointer type mismatch ('__global int *' and '__local int *')}}
+} 
----------------
bader wrote:
> Note that test doesn't specify OpenCL version. By default it's 1.0, so ptr points to private AS and it's illegal to cast pointers from different address spaces in OpenCL v1.x.
Let's discuss in  https://llvm.org/bugs/show_bug.cgi?id=19957


http://reviews.llvm.org/D16682





More information about the cfe-commits mailing list