Be sure to do unary conversions on the operand to an ARC
bridged cast. Noticed by AST inspection by Ted Kremenek!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138616 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index f3893ce..db5de4c 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -1820,6 +1820,10 @@
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();