brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 854572e Raw
48 lines · plain
1// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s2 3@protocol FooAsID4@property (assign) id foo; // expected-note 2 {{it could also be property of type 'id' declared here}} \\5			 // expected-warning {{property of type 'id' was selected for synthesis}}6@end7 8@protocol FooAsDouble9@property double foo; // expected-warning 2 {{property of type 'double' was selected for synthesis}} \10		      // expected-note {{it could also be property of type 'double' declared here}}11@end12 13@protocol FooAsShort14@property short foo; // expected-note {{it could also be property of type 'short' declared here}}15@end16 17@interface NSObject @end18 19@interface AnObject : NSObject<FooAsDouble,FooAsID>20@end21 22@interface Sub : AnObject23@end24 25@implementation Sub26@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}27@end28 29 30@interface AnotherObject : NSObject<FooAsDouble, FooAsID,FooAsDouble, FooAsID, FooAsDouble,FooAsID>31@end32 33@implementation AnotherObject34@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}35@end36 37 38@interface YetAnotherObject : NSObject<FooAsID,FooAsShort, FooAsDouble,FooAsID, FooAsShort>39@end40 41@implementation YetAnotherObject42@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}43@end44 45double func(YetAnotherObject *object) {46  return [object foo]; // expected-error {{returning 'id' from a function with incompatible result type 'double'}}47}48