brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4952bd8 Raw
58 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2@interface I3{4}5@property int IP;6@end7 8@implementation I9@synthesize IP;10- (int) Meth {11   return IP;12}13@end14 15int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is private}}16 17@interface I1 {18 int protected_ivar;19}20@property int PROP_INMAIN;21@end22 23@interface I1() {24 int private_ivar;25}26@property int PROP_INCLASSEXT;27@end28 29@implementation I130- (int) Meth {31   _PROP_INMAIN = 1;32   _PROP_INCLASSEXT = 2;33   protected_ivar = 1;	// OK34   return private_ivar; // OK35}36@end37 38 39@interface DER : I140@end41 42@implementation DER43- (int) Meth {44   protected_ivar = 1;	// OK45   _PROP_INMAIN = 1; // expected-error {{instance variable '_PROP_INMAIN' is private}}46   _PROP_INCLASSEXT = 2; // expected-error {{instance variable '_PROP_INCLASSEXT' is private}}47   return private_ivar; // expected-error {{instance variable 'private_ivar' is private}}48}49@end50 51@interface A52@property (weak) id testObjectWeakProperty; // expected-note {{declared here}}53@end54 55@implementation A56@synthesize testObjectWeakProperty; // expected-error {{cannot synthesize weak property because the current deployment target does not support weak references}}57@end58