]> granicus.if.org Git - clang/commitdiff
reapply john's patch, he broke mainline again by changing the test.
authorChris Lattner <sabre@nondot.org>
Tue, 20 Apr 2010 05:19:10 +0000 (05:19 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 20 Apr 2010 05:19:10 +0000 (05:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101871 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp
test/Parser/altivec.c
test/Parser/cxx-altivec.cpp

index 7929b588b63dada251aae3bc68ea6a3184525dd5..981d5831b0c06a60db3573b12c3c3ffa12d093bf 100644 (file)
@@ -886,7 +886,7 @@ void InitListChecker::CheckVectorType(const InitializedEntity &Entity,
 
     // OpenCL & AltiVec require all elements to be initialized.
     if (numEltsInit != maxElements)
-      if (SemaRef.getLangOptions().OpenCL || SemaRef.getLangOptions().AltiVec)
+      if (SemaRef.getLangOptions().OpenCL)
         SemaRef.Diag(IList->getSourceRange().getBegin(),
                      diag::err_vector_incorrect_num_initializers)
           << (numEltsInit < maxElements) << maxElements << numEltsInit;
index a3e8183f359a8e64529612377adff8805dd4a8a7..ed144573fcd296c9d7a259020bf0e6fc71043e04 100644 (file)
@@ -40,6 +40,8 @@ vector int f__r();
 void f_a(vector int a);
 void f_a2(int b, vector int a);
 
+vector int v = (vector int)(-1);
+
 // These should have warnings.
 __vector long vv_l;                 // expected-warning {{Use of 'long' with '__vector' is deprecated}}
 __vector signed long vv_sl;         // expected-warning {{Use of 'long' with '__vector' is deprecated}}
index 7f7a9d2df68028810e888531d1dfa794b703f7c4..66d4f3263b9ae7b551a80d2e4904400eeffdaf96 100644 (file)
@@ -41,6 +41,8 @@ vector int f__r();
 void f_a(vector int a);
 void f_a2(int b, vector int a);
 
+vector int v = (vector int)(-1);
+
 // These should have warnings.
 __vector long vv_l;                 // expected-warning {{Use of 'long' with '__vector' is deprecated}}
 __vector signed long vv_sl;         // expected-warning {{Use of 'long' with '__vector' is deprecated}}