Skip to content

Commit

Permalink
[OpenCL] Handle OpenCL specific subelement types
Browse files Browse the repository at this point in the history
Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

llvm-svn: 302633
  • Loading branch information
echuraev committed May 10, 2017
1 parent 4e1377a commit 45fe70f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaInit.cpp
Expand Up @@ -1209,7 +1209,7 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,

} else {
assert((ElemType->isRecordType() || ElemType->isVectorType() ||
ElemType->isClkEventT()) && "Unexpected type");
ElemType->isOpenCLSpecificType()) && "Unexpected type");

// C99 6.7.8p13:
//
Expand Down
20 changes: 20 additions & 0 deletions clang/test/SemaOpenCL/array-init.cl
@@ -0,0 +1,20 @@
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
// expected-no-diagnostics

__kernel void k1(queue_t q1, queue_t q2) {
queue_t q[] = {q1, q2};
}

__kernel void k2(read_only pipe int p) {
reserve_id_t i1 = reserve_read_pipe(p, 1);
reserve_id_t i2 = reserve_read_pipe(p, 1);
reserve_id_t i[] = {i1, i2};
}

event_t create_event();
__kernel void k3() {
event_t e1 = create_event();
event_t e2 = create_event();
event_t e[] = {e1, e2};
}

0 comments on commit 45fe70f

Please sign in to comment.