Anastasia added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:6853
+if (R->isReserveIDT() || R->isClkEventT() || R->isEventT() ||
+R.getUnqualifiedType().getAsString() == "ndrange_t" || R->isQueueT()) {
Se.Diag(NewVD->getLocation(),
cycheng added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:6853
+if (R->isReserveIDT() || R->isClkEventT() || R->isEventT() ||
+R.getUnqualifiedType().getAsString() == "ndrange_t" || R->isQueueT()) {
Se.Diag(NewVD->getLocation(),
An
Anastasia added inline comments.
Herald added a subscriber: Naghasan.
Comment at: clang/test/SemaOpenCL/invalid-types.cl:10
+
+typedef image2d_t test;
+global test qtt; // expected-error {{the '__global ndrange_t' type cannot be
used to declare a program scope variable}}
---
Anastasia added inline comments.
Comment at: clang/test/SemaOpenCL/invalid-types.cl:5
+// Test declare "Other Data Type" variables in program scope.
+global queue_t qt; // expected-error {{the '__global queue_t' type cannot be
used to declare a program scope variable}}
+
---
cycheng updated this revision to Diff 382816.
cycheng added a comment.
previous update was using wrong file, sorry!!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112110/new/
https://reviews.llvm.org/D112110
Files:
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaOpenCL/invalid-types.cl
cycheng updated this revision to Diff 382813.
cycheng marked 2 inline comments as done.
cycheng added a comment.
- Remove OpenCL 2.0 description
- Merge test files into single test file
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112110/new/
https://reviews.llvm.org/D112110
Files:
Anastasia added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:6844
// scope.
+ // OpenCL v2.0 s6.5.1:
+ // Variables defined at program scope and static variables inside a function
To make things concise I would suggest dropping OpenCL v2.0 quote
cycheng created this revision.
cycheng added a reviewer: Anastasia.
Herald added subscribers: ldrumm, yaxunl.
cycheng requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
OpenCL v2.0 s6.5.1 and OpenCL v3.0 s6.11.w both state: Program scope varia