diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/protocol-forward-1.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/protocol-forward-1.mm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm b/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm new file mode 100644 index 000000000..03c7ae065 --- /dev/null +++ b/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 + |