From 4906cf97fb6b7aebf5b1b8b99762f0f8fe1f15ea Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 26 Aug 2011 00:48:42 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaExprObjC.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index f3893ce2a5..db5de4ca9c 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/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(); -- 2.50.1