[cfe-commits] r49098 - /cfe/trunk/lib/Sema/SemaExprObjC.cpp
Chris Lattner
sabre at nondot.org
Wed Apr 2 10:17:45 PDT 2008
Author: lattner
Date: Wed Apr 2 12:17:33 2008
New Revision: 49098
URL: http://llvm.org/viewvc/llvm-project?rev=49098&view=rev
Log:
properly handle array decay in objc message exprs.
Modified:
cfe/trunk/lib/Sema/SemaExprObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=49098&r1=49097&r2=49098&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Wed Apr 2 12:17:33 2008
@@ -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.
More information about the cfe-commits
mailing list