diff options
author | no-author <no-author@gcc.gnu.org> | 2005-06-10 17:31:57 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2005-06-10 17:31:57 +0000 |
commit | 85cf36f96c44c051d02a5b78d72b3154e7049e9a (patch) | |
tree | 094a0e787493643baee9b52cacf6bf102b83b3ce /gcc/testsuite/objc.dg/comp-types-10.m | |
parent | 5522c3dad6327550d6ba159ad82df3d6ebb32c7e (diff) |
This commit was manufactured by cvs2svn to create branch
'apple-local-200502-branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@100821 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg/comp-types-10.m')
-rw-r--r-- | gcc/testsuite/objc.dg/comp-types-10.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/comp-types-10.m b/gcc/testsuite/objc.dg/comp-types-10.m new file mode 100644 index 00000000000..8cd53404f52 --- /dev/null +++ b/gcc/testsuite/objc.dg/comp-types-10.m @@ -0,0 +1,28 @@ +/* { dg-do compile } */ + +#include <objc/Object.h> + +@protocol Foo +- (id)meth1; +- (id)meth2:(int)arg; +@end + +@interface Derived1: Object +@end + +@interface Derived2: Object ++ (Derived1 *)new; +@end + +id<Foo> func(void) { + Object *o = [Object new]; + return o; /* { dg-warning "class .Object. does not implement the .Foo. protocol" } */ +} + +@implementation Derived2 ++ (Derived1 *)new { + Derived2 *o = [super new]; + return o; /* { dg-warning "distinct Objective\\-C type in return" } */ +} +@end + |