File: property-9.m

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (120 lines) | stat: -rw-r--r-- 2,521 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s

typedef signed char BOOL;
@protocol NSObject  - (BOOL)isEqual:(id)object; @end

@interface NSObject <NSObject> {} @end

@interface _NSServicesInContextMenu : NSObject {
    id _requestor;
    NSObject *_appleEventDescriptor;
}

@property (retain, nonatomic) id requestor;
@property (retain, nonatomic) id appleEventDescriptor;

@end

@implementation _NSServicesInContextMenu

@synthesize requestor = _requestor, appleEventDescriptor = _appleEventDescriptor;

@end

@class NSString;

@protocol MyProtocol
- (NSString *)stringValue;
@end

@interface MyClass : NSObject {
  id  _myIvar;
}
@property (readwrite, retain) id<MyProtocol> myIvar;
@end

@implementation MyClass
@synthesize myIvar = _myIvar;
@end


@interface BadPropClass
{
 int _awesome;
}

@property (readonly) int; // expected-warning {{declaration does not declare anything}}
@property (readonly) ; // expected-error {{type name requires a specifier or qualifier}}
@property (readonly) int : 4; // expected-error {{property requires fields to be named}}


// test parser recovery
@property (                           // expected-note {{to match this '('}}
           readonly getter=isAwesome) // expected-error {{expected ')'}}
           
  int _awesome;
@property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}
  int _awesome2;

@property (    // expected-note {{to match this '('}}
           +)  // expected-error {{expected ')'}}
           
  int _awesome3;

@end

@protocol PVImageViewProtocol
@property int inEyeDropperMode;
@end

@interface Cls
@property int inEyeDropperMode;
@end

@interface PVAdjustColor @end

@implementation PVAdjustColor

- xx {
  id <PVImageViewProtocol> view;
  Cls *c;

  c.inEyeDropperMode = 1;
  view.inEyeDropperMode = 1;
}
@end

@interface MyStyleIntf 
{
    int _myStyle;
}

@property(readonly) int myStyle;

- (float)setMyStyle:(int)style;
@end

@class MDAInstance; // expected-note {{forward declaration of class here}}

@interface MDATestDocument
@property(retain) MDAInstance *instance;
@end

id f0(MDATestDocument *d) {
  return d.instance.path; // expected-error {{property 'path' cannot be found in forward class object 'MDAInstance'}}
}

@interface UIView @end

@interface FRFakeBannerView : UIView
@end

@interface FRAdCollectionViewCell
@property (nonatomic, weak, readonly) UIView *bannerView;
@end

@interface FRAdCollectionViewCell () 

@property (nonatomic, weak, readwrite) FRFakeBannerView *bannerView;

@end