aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm
new file mode 100644
index 000000000..03c7ae065
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm
@@ -0,0 +1,27 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* Test that all protocols appearing in @interface declarations are
+ real (ie, we saw a full @protocol definition with list of methods),
+ and not just forward-references (ie, "@protocol NSObject;"). */
+
+#include <objc/objc.h>
+
+@protocol MyProtocol;
+
+@protocol MyProtocol2
+- (int)method2;
+@end
+
+@interface MyClass <MyProtocol> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
+@end
+
+@interface MyClass2 <MyProtocol2> /* Ok */
+@end
+
+@interface MyClass2 (Category) <MyProtocol> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
+@end
+
+@protocol MyProtocol3 <MyProtocol> /* Ok */
+@end
+