Handle forward declaration of classes and prevent re-instantiation of
ObjcInterfaceClass Objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42172 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/forward-class-1.m b/test/Sema/forward-class-1.m
new file mode 100644
index 0000000..4e4e319
--- /dev/null
+++ b/test/Sema/forward-class-1.m
@@ -0,0 +1,22 @@
+@class FOO, BAR;
+@class FOO, BAR;
+
+@interface INTF : FOO	// expected-error {{cannot find interface declaration for 'FOO', superclass of 'INTF'}}
+@end
+
+@interface FOO 
+- (BAR*) Meth1;
+- (FOO*) Meth2;
+@end
+
+@interface INTF1 : FOO	
+@end
+
+@interface INTF2 : INTF1
+@end
+
+
+@class INTF1, INTF2;
+
+@interface INTF2 : INTF1 // expected-error {{duplicate interface declaration for class 'INTF2'}}
+@end