summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-09-17 22:59:41 +0000
committerNico Weber <nicolasweber@gmx.de>2011-09-17 22:59:41 +0000
commit7c29980d2090e47cb05f627eed604c9dea3a6ce6 (patch)
tree758cfde6575debb56bb8f9e4aca25cf78e437c7b /clang/lib/Sema/SemaChecking.cpp
parentdb8015c4497a0527de48c4865edfc09403091eb9 (diff)
downloadbcm5719-llvm-7c29980d2090e47cb05f627eed604c9dea3a6ce6.tar.gz
bcm5719-llvm-7c29980d2090e47cb05f627eed604c9dea3a6ce6.zip
Let -Warray-bounds handle casted array types without false positives.
Fixes PR10771. llvm-svn: 139990
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 6e750c182b1..aecc659485d 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3709,7 +3709,7 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr,
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);
OpenPOWER on IntegriCloud