diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-18 23:32:10 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-18 23:32:10 +0000 |
commit | 2ea784be619b970cb0e2c718427c0c2944f32427 (patch) | |
tree | 6aa7aaf4edf2fc98278364c2ae3ee2a5ed447736 /gcc/testsuite/objc.dg/proto-init-mimatch-1.m | |
parent | e1f293c058be8dc742a0414d106df0ebc782a925 (diff) | |
download | gcc-2ea784be619b970cb0e2c718427c0c2944f32427.tar.gz |
In gcc/testsuite/:
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from 'apple/trunk' branch on FSF servers.
2006-03-16 Fariborz Jahanian <fjahanian@apple.com>
Radar 4293709
* objc.dg/proto-init-mimatch-1.m: New.
* obj-c++.dg/proto-init-mimatch-1.mm: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg/proto-init-mimatch-1.m')
-rw-r--r-- | gcc/testsuite/objc.dg/proto-init-mimatch-1.m | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/proto-init-mimatch-1.m b/gcc/testsuite/objc.dg/proto-init-mimatch-1.m new file mode 100644 index 00000000000..64e52e81262 --- /dev/null +++ b/gcc/testsuite/objc.dg/proto-init-mimatch-1.m @@ -0,0 +1,35 @@ +/* Test to warn on protocol mismatch in a variety of initializations. */ + +/* { dg-do compile } */ + +typedef struct objc_class *Class; + +typedef struct objc_object { + Class isa; +} *id; + +@protocol NSObject +@end + +@interface NSObject <NSObject> +@end + +@protocol NSCopying +- (void)copyWithZone; +@end + +@interface Foo:NSObject <NSCopying> +@end + + +extern id <NSObject> NSCopyObject(); + +@implementation Foo +- (void)copyWithZone { + Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */ + + Foo<NSObject,NSCopying> *g = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */ + + id<NSObject,NSCopying> h = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */ +} +@end |