summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-08-26 00:48:42 +0000
committerJohn McCall <rjmccall@apple.com>2011-08-26 00:48:42 +0000
commiteb07554d9c45d8af45e39b015f289c9c7f45aff3 (patch)
tree2070d6edf33de13c5624c7a8c02a683d8f618911 /clang/lib/Sema/SemaExprObjC.cpp
parent35e4f0cd0fc0e7f23b10c597f840639199f99eb0 (diff)
downloadbcm5719-llvm-eb07554d9c45d8af45e39b015f289c9c7f45aff3.tar.gz
bcm5719-llvm-eb07554d9c45d8af45e39b015f289c9c7f45aff3.zip
Be sure to do unary conversions on the operand to an ARC
bridged cast. Noticed by AST inspection by Ted Kremenek! llvm-svn: 138616
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index f3893ce2a58..db5de4ca9c0 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -1820,6 +1820,10 @@ ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc,
SourceLocation BridgeKeywordLoc,
TypeSourceInfo *TSInfo,
Expr *SubExpr) {
+ ExprResult SubResult = UsualUnaryConversions(SubExpr);
+ if (SubResult.isInvalid()) return ExprError();
+ SubExpr = SubResult.take();
+
QualType T = TSInfo->getType();
QualType FromType = SubExpr->getType();
OpenPOWER on IntegriCloud