Remove default argument for ImpCastExprToType.  Add appropriate argument 
to all callers.  Switch a few other users of CK_Unknown to proper cast 
kinds.

Note that there are still some situations where we end up with 
CK_Unknown; they're pretty easy to find with grep. There 
are still a few missing conversion kinds, specifically 
pointer/int/float->bool and the various combinations of real/complex 
float/int->real/complex float/int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84623 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index d7e4e4a..b78c10b 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -636,7 +636,11 @@
     // 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)