OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [proto-init-mimatch-1.m] - Rev 711

Go to most recent revision | Compare with Previous | Blame | View Log

/* 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	
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.