diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-02 17:17:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-02 17:17:33 +0000 |
commit | 987798ad1d5db2a8ec26cd5bbe434b35ad32659c (patch) | |
tree | 13e86d83e2da73b6cbc2c8c3a98c4d81db63747f /lib/Sema/SemaExprObjC.cpp | |
parent | 26b7661b1db92ed611f5c02d61e40e4071aa2058 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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. |