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

Igor Chesnokov via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 5 10:46:54 PST 2016


ichesnokov added inline comments.

================
Comment at: test/SemaOpenCL/ternary-implicit-casts.cl:6
@@ +5,3 @@
+	// will not compile, ptr is not generic but local
+  local int *ptr = cond ? gint : lint; // expected-warning {{pointer type mismatch ('__global int *' and '__local int *')}} expected-error {{initializing '__local int *' with an expression of type 'void *' changes address space of pointer}}
+}
----------------
Anastasia wrote:
> Again, I am not quite clear about the purpose of this change.
> 
> We have similar testing in test/SemaOpenCL/address-spaces-conversions-cl2.0.cl.
> 
> However, the diagnostics, that Clang currently gives, seem wrong to me. We might need to investigate that.
This test point is the ternary operator. It displays that ternary operator may return not only in different values, but also different address spaces. I do not see such check in address-spaces-conversions-cl2.0.cl.


http://reviews.llvm.org/D16682





More information about the cfe-commits mailing list