diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-23 14:22:18 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-23 14:22:18 +0000 |
| commit | 73490b890977362d28dd6326843a1ecae413921d (patch) | |
| tree | 3fdd91eae574e32453a4baf462961c742df2691a /lib/Sema/SemaExprObjC.cpp | |
| parent | a5f348eb914e67b51914117fac117c18c1f8d650 (diff) | |
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
| -rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index d7e4e4a67fe96..b78c10b0dd80c 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -636,7 +636,11 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, // Implicitly convert integers and pointers to 'id' but emit a warning. Diag(lbrac, diag::warn_bad_receiver_type) << RExpr->getType() << RExpr->getSourceRange(); - ImpCastExprToType(RExpr, Context.getObjCIdType()); + if (ReceiverCType->isPointerType()) + ImpCastExprToType(RExpr, Context.getObjCIdType(), CastExpr::CK_BitCast); + else + ImpCastExprToType(RExpr, Context.getObjCIdType(), + CastExpr::CK_IntegralToPointer); } else { // Reject other random receiver types (e.g. structs). Diag(lbrac, diag::err_bad_receiver_type) |
