[PATCH] D30643: [OpenCL] Extended diagnostics for atomic initialization

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 31 10:22:37 PDT 2017


Anastasia added inline comments.


================
Comment at: test/SemaOpenCL/atomic-init.cl:6
+kernel void test_atomic_initialization() {
+  a1 = 1; // expected-error {{atomic variable can only be assigned to a compile time constant}}
+  atomic_int a2 = 0; // expected-error {{atomic variable can be initialized to a variable only in global address space}}
----------------
This diagnostic seems wrong! How is 1 not a compile time constant?

Didn't we agree to drop the constant bit from the error message and just keep reporting about the program (global visibility) scope? I think the restriction about the scope holds for both initialization and assignment and therefore I have asked to unify the diagnostic...


https://reviews.llvm.org/D30643





More information about the cfe-commits mailing list