diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 59901cb..77cfe6c 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -3795,15 +3795,8 @@
   setSequenceKind(NormalSequence);
 
   for (unsigned I = 0; I != NumArgs; ++I)
-    if (Args[I]->getObjectKind() == OK_ObjCProperty) {
-      ExprResult Result = S.ConvertPropertyForRValue(Args[I]);
-      if (Result.isInvalid()) {
-        SetFailed(FK_ConversionFromPropertyFailed);
-        return;
-      }
-      Args[I] = Result.take();
-    } else if (const BuiltinType *PlaceholderTy
-                 = Args[I]->getType()->getAsPlaceholderType()) {
+    if (const BuiltinType *PlaceholderTy
+          = Args[I]->getType()->getAsPlaceholderType()) {
       // FIXME: should we be doing this here?
       if (PlaceholderTy->getKind() != BuiltinType::Overload) {
         ExprResult result = S.CheckPlaceholderExpr(Args[I]);
@@ -4493,13 +4486,6 @@
     assert(Args.size() == 1);
     CurInit = Args.get()[0];
     if (!CurInit.get()) return ExprError();
-
-    // Read from a property when initializing something with it.
-    if (CurInit.get()->getObjectKind() == OK_ObjCProperty) {
-      CurInit = S.ConvertPropertyForRValue(CurInit.take());
-      if (CurInit.isInvalid())
-        return ExprError();
-    }
     break;
   }
 
