[OpenCL] Extended diagnostics for atomic initialization
authorEgor Churaev <egor.churaev@gmail.com>
Wed, 5 Apr 2017 12:47:10 +0000 (12:47 +0000)
committerEgor Churaev <egor.churaev@gmail.com>
Wed, 5 Apr 2017 12:47:10 +0000 (12:47 +0000)
commit3bccec5da7e553e4291ed5f1ad069fe68cb20a43
tree071299c471a2866743b0b2200629ece0f1743bfb
parent34e29784fbfa75fb654575657a7c149ac25d14c3
[OpenCL] Extended diagnostics for atomic initialization

Summary:
I saw the same changes in the following review: https://reviews.llvm.org/D17438

I don't know in that way I could determine that atomic variable was initialized by macro ATOMIC_VAR_INIT. Anyway I added check that atomic variables can be initialize only in global scope.
I think that we can discuss this change.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D30643

llvm-svn: 299537
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaInit.cpp
clang/test/Parser/opencl-atomics-cl20.cl
clang/test/SemaOpenCL/atomic-init.cl [new file with mode: 0644]