[PATCH] D17345: [OpenCL] Improve diagnostics of address spaces for variables inside function

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 12:03:42 PST 2016


yaxunl accepted this revision.
yaxunl added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


================
Comment at: test/SemaOpenCL/storageclass-cl20.cl:23
@@ -19,1 +22,3 @@
+  extern global int G5;
+  extern int G6; // expected-error{{program scope variable must reside in global or constant address space}}
 }
----------------
Anastasia wrote:
> Apparently not, because we only apply global as default address space to program (non-function) scope declarations. I am not sure what we should do here though, but this perhaps doesn't belong to this change.
> 
> Do we need clarifications with Khronos here?
Agree this may need another patch.

The spec is not clear about default addr space for function-scope extern variables. I think better to ask Khronos for clarification.


http://reviews.llvm.org/D17345





More information about the cfe-commits mailing list