summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-10-14 18:55:27 +0000
committerTed Kremenek <kremenek@apple.com>2013-10-14 18:55:27 +0000
commita553fbfcd13777f23c563748ea803b2bcdc10ead (patch)
tree4a3f3a98e1774469b47cff147258a8f1f1c80a27 /clang/lib/Sema/SemaChecking.cpp
parent1f39e343ef84f6c506a5053d06394266661280bd (diff)
downloadbcm5719-llvm-a553fbfcd13777f23c563748ea803b2bcdc10ead.tar.gz
bcm5719-llvm-a553fbfcd13777f23c563748ea803b2bcdc10ead.zip
GetExprRange() (used by -Wconversion checking) should look through OpaqueValueExprs.
Fixes a false positive with -Wconversion involving Objective-C properties. Fixes <rdar://problem/14415662>. llvm-svn: 192611
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 426bf68e1d6..94a58cc625a 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -4665,6 +4665,9 @@ static IntRange GetExprRange(ASTContext &C, Expr *E, unsigned MaxWidth) {
}
}
+ if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(E))
+ return GetExprRange(C, OVE->getSourceExpr(), MaxWidth);
+
if (FieldDecl *BitField = E->getSourceBitField())
return IntRange(BitField->getBitWidthValue(C),
BitField->getType()->isUnsignedIntegerOrEnumerationType());
OpenPOWER on IntegriCloud