Allow reference binding of a reference of Objective-C object type to
an lvalue of another, compatible Objective-C object type (e.g., a
subclass). Introduce a new initialization sequence step kind to
describe this binding, along with a new cast kind. Fixes PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110513 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjCXX/references.mm b/test/SemaObjCXX/references.mm
index 9eceeaf..a6c267d 100644
--- a/test/SemaObjCXX/references.mm
+++ b/test/SemaObjCXX/references.mm
@@ -31,3 +31,22 @@
 void f4(NSString &tmpstr) {
   f3(&tmpstr);
 }
+
+// PR7741
+@protocol P1 @end
+@protocol P2 @end
+@protocol P3 @end
+@interface foo<P1> {} @end
+@interface bar : foo <P1, P2> {} @end
+typedef bar baz;
+void f5(foo&);
+void f5b(foo<P1>&);
+void f5c(foo<P2>&);
+void f5d(foo<P3>&);
+void f6(baz* x) { 
+  f5(*x); 
+  f5b(*x); 
+  f5c(*x); 
+  f5d(*x);
+  (void)((foo&)*x);  
+}