Let -Warray-bounds handle casted array types without false positives.
Fixes PR10771.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139990 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 6e750c1..aecc659 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -3709,7 +3709,7 @@
return;
const Type* BaseType = getElementType(BaseExpr);
- if (!isSubscript && BaseType != EffectiveType) {
+ if (BaseType != EffectiveType) {
// Make sure we're comparing apples to apples when comparing index to size
uint64_t ptrarith_typesize = Context.getTypeSize(EffectiveType);
uint64_t array_typesize = Context.getTypeSize(BaseType);