An Obj-C message send expression can never have a reference type.

llvm-svn: 72417
This commit is contained in:
Anders Carlsson 2009-05-26 15:22:25 +00:00
parent a30d046059
commit 09ac6f21c3
1 changed files with 7 additions and 0 deletions

View File

@ -444,6 +444,8 @@ Sema::ExprResult Sema::ActOnClassMessage(
lbrac, rbrac, returnType))
return true;
returnType = returnType.getNonReferenceType();
// If we have the ObjCInterfaceDecl* for the class that is receiving the
// message, use that to construct the ObjCMessageExpr. Otherwise pass on the
// IdentifierInfo* for the class.
@ -500,6 +502,8 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false,
lbrac, rbrac, returnType))
return true;
returnType = returnType.getNonReferenceType();
return new (Context) ObjCMessageExpr(RExpr, Sel, returnType, Method, lbrac,
rbrac, ArgExprs, NumArgs);
}
@ -515,6 +519,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false,
lbrac, rbrac, returnType))
return true;
returnType = returnType.getNonReferenceType();
return new (Context) ObjCMessageExpr(RExpr, Sel, returnType, Method, lbrac,
rbrac, ArgExprs, NumArgs);
}
@ -556,6 +561,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false,
lbrac, rbrac, returnType))
return true;
returnType = returnType.getNonReferenceType();
return new (Context) ObjCMessageExpr(RExpr, Sel, returnType, Method, lbrac,
rbrac, ArgExprs, NumArgs);
}
@ -632,6 +638,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false,
lbrac, rbrac, returnType))
return true;
returnType = returnType.getNonReferenceType();
return new (Context) ObjCMessageExpr(RExpr, Sel, returnType, Method, lbrac,
rbrac, ArgExprs, NumArgs);
}