aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2011-07-15 23:07:01 +0000
committerTanya Lattner <tonic@nondot.org>2011-07-15 23:07:01 +0000
commit61b4bc80e943578ae855810918a1dc9697dbd15b (patch)
treec7dbecf09859eed29a717583c3bce74daf3f690e /lib/Sema/SemaInit.cpp
parentdeefaf6eac47046f60b059d519585c42618a5291 (diff)
This handles the missing cases of opencl vector literals.
Test cases provided by Anton Lokhmot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 835d837e4c..9fbcbab0b7 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -769,7 +769,8 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
// subaggregate, brace elision is assumed and the initializer is
// considered for the initialization of the first member of
// the subaggregate.
- if (ElemType->isAggregateType() || ElemType->isVectorType()) {
+ if (!SemaRef.getLangOptions().OpenCL &&
+ (ElemType->isAggregateType() || ElemType->isVectorType())) {
CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList,
StructuredIndex);
++StructuredIndex;