From: Nate Begeman Date: Tue, 7 Jul 2009 21:53:06 +0000 (+0000) Subject: Extra vector element initializers in OpenCL is an error, not a warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0863452c21e3e6da5b2613fd455495486c1ad5df;p=clang Extra vector element initializers in OpenCL is an error, not a warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74951 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 5be07e3986..52099a3d90 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -554,6 +554,10 @@ void InitListChecker::CheckExplicitInitList(InitListExpr *IList, QualType &T, DK = diag::err_excess_initializers; hadError = true; } + if (SemaRef.getLangOptions().OpenCL && initKind == 1) { + DK = diag::err_excess_initializers; + hadError = true; + } SemaRef.Diag(IList->getInit(Index)->getLocStart(), DK) << initKind << IList->getInit(Index)->getSourceRange();