]> granicus.if.org Git - clang/commitdiff
properly handle array decay in objc message exprs.
authorChris Lattner <sabre@nondot.org>
Wed, 2 Apr 2008 17:17:33 +0000 (17:17 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 2 Apr 2008 17:17:33 +0000 (17:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprObjC.cpp

index 00361658f7565b4b0c50e3860d0ed8e0a7ea9987..ec6e41bf39f25c6d9e59b794e9293a6aac6ae2a8 100644 (file)
@@ -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.