From eb07554d9c45d8af45e39b015f289c9c7f45aff3 Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 26 Aug 2011 00:48:42 +0000 Subject: Be sure to do unary conversions on the operand to an ARC bridged cast. Noticed by AST inspection by Ted Kremenek! llvm-svn: 138616 --- clang/lib/Sema/SemaExprObjC.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Sema/SemaExprObjC.cpp') 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(); -- cgit v1.2.3