properly handle array decay in objc message exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49098 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 0036165..ec6e41b 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -114,13 +114,13 @@
QualType rhsType = argExpr->getType();
// If necessary, apply function/array conversion. C99 6.7.5.3p[7,8].
- if (const ArrayType *ary = lhsType->getAsArrayType())
- lhsType = Context.getPointerType(ary->getElementType());
+ if (lhsType->isArrayType())
+ lhsType = Context.getArrayDecayedType(lhsType);
else if (lhsType->isFunctionType())
lhsType = Context.getPointerType(lhsType);
- AssignConvertType Result = CheckSingleAssignmentConstraints(lhsType,
- argExpr);
+ AssignConvertType Result =
+ CheckSingleAssignmentConstraints(lhsType, argExpr);
if (Args[i] != argExpr) // The expression was converted.
Args[i] = argExpr; // Make sure we store the converted expression.