From: Anders Carlsson Date: Tue, 26 May 2009 15:22:25 +0000 (+0000) Subject: An Obj-C message send expression can never have a reference type. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=187ba159b04d8cc760daeee5cfbbc69450b2d50d;p=clang An Obj-C message send expression can never have a reference type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72417 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 1ad9096e50..3bee461cf6 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -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); }