Extra vector element initializers in OpenCL is an error, not a warning.

llvm-svn: 74951
This commit is contained in:
Nate Begeman 2009-07-07 21:53:06 +00:00
parent 8ec8c97f81
commit 425038cc6d
1 changed files with 4 additions and 0 deletions

View File

@ -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();