ObjectiveC ARC. More validation of toll-free bridging of
CF objects with objc_bridge'ing annotaiton.
// rdar://15454846


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194938 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index ea1f2a9..b59e0a6 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -3190,7 +3190,11 @@
               S.Diag(castExpr->getLocStart(), diag::warn_objc_invalid_bridge)
                 << TDNDecl->getName() << Target->getName() << CastClass->getName();
               return true;
-            }
+            } else {
+              S.Diag(castExpr->getLocStart(), diag::warn_objc_invalid_bridge)
+                << TDNDecl->getName() << Target->getName() << castType;
+              return true;
+           }
           }
         }
         S.Diag(castExpr->getLocStart(), diag::err_objc_cf_bridged_not_interface)
@@ -3233,6 +3237,11 @@
                 << ExprClass->getName() << TDNDecl->getName();
               S.Diag(TDNDecl->getLocStart(), diag::note_declared_at);
               return true;
+            } else {
+              S.Diag(castExpr->getLocStart(), diag::warn_objc_invalid_bridge_to_cf)
+                << castExpr->getType() << castType;
+              S.Diag(TDNDecl->getLocStart(), diag::note_declared_at);
+              return true;
             }
           }
         }