Index: lib/Sema/SemaCast.cpp
===================================================================
--- lib/Sema/SemaCast.cpp	(revision 148198)
+++ lib/Sema/SemaCast.cpp	(working copy)
@@ -1619,16 +1619,6 @@
     
     return TC_Failed;
   }
-  
-  bool destIsPtr = DestType->isAnyPointerType() ||
-                   DestType->isBlockPointerType();
-  bool srcIsPtr = SrcType->isAnyPointerType() ||
-                  SrcType->isBlockPointerType();
-  if (!destIsPtr && !srcIsPtr) {
-    // Except for std::nullptr_t->integer and lvalue->reference, which are
-    // handled above, at least one of the two arguments must be a pointer.
-    return TC_NotApplicable;
-  }
 
   if (SrcType == DestType) {
     // C++ 5.2.10p2 has a note that mentions that, subject to all other
@@ -1641,6 +1631,16 @@
     return TC_Success;
   }
 
+  bool destIsPtr = DestType->isAnyPointerType() ||
+                   DestType->isBlockPointerType();
+  bool srcIsPtr = SrcType->isAnyPointerType() ||
+                  SrcType->isBlockPointerType();
+  if (!destIsPtr && !srcIsPtr) {
+    // Except for std::nullptr_t->integer and lvalue->reference, which are
+    // handled above, at least one of the two arguments must be a pointer.
+    return TC_NotApplicable;
+  }
+
   if (DestType->isIntegralType(Self.Context)) {
     assert(srcIsPtr && "One type must be a pointer");
     // C++ 5.2.10p4: A pointer can be explicitly converted to any integral
