From: Chris Lattner Date: Wed, 2 Apr 2008 17:17:33 +0000 (+0000) Subject: properly handle array decay in objc message exprs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=987798ad1d5db2a8ec26cd5bbe434b35ad32659c;p=clang 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 00361658f7..ec6e41bf39 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -114,13 +114,13 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs, 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.