rdar://
35041502
Differential Revision: https://reviews.llvm.org/D44172
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326952
91177308-0d34-0410-b5e6-
96231b3b80d8
// Indexing with 0 is OK.
if (Idx.isZeroConstant())
return;
+
+ // Indexing vector-type expressions is also OK.
+ if (SubsExpr->getBase()->getType()->isVectorType())
+ return;
reportPointerArithMisuse(SubsExpr->getBase(), C);
}
a[0] = 0;
label:;
}
+
+typedef __attribute__((__ext_vector_type__(2))) float simd_float2;
+float test_nowarning_on_vector_deref() {
+ simd_float2 x = {0, 1};
+ return x[1]; // no-warning
+}