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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wselector-type-mismatch %s
__attribute__((objc_root_class))
@interface Inteface_Implementation
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct;
@end
@implementation Inteface_Implementation
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
__attribute__((objc_root_class))
@interface Inteface_Extension
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct;
@property(nonatomic, readonly, direct) int direct_direct;
@end
@interface Inteface_Extension ()
@property(nonatomic, readwrite) int normal_normal;
@property(nonatomic, readwrite) int direct_normal;
@property(nonatomic, readwrite, direct) int normal_direct;
@property(nonatomic, readwrite, direct) int direct_direct;
@end
@implementation Inteface_Extension
@end
__attribute__((objc_root_class))
@interface Extension_Implementation
@end
@interface Extension_Implementation ()
@property(nonatomic, readwrite) int normal_normal;
@property(nonatomic, readwrite, direct) int direct_normal;
@property(nonatomic, readwrite) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readwrite, direct) int direct_direct;
@end
@implementation Extension_Implementation
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
__attribute__((objc_root_class))
@interface Inteface_Category
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Inteface_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Inteface_Category
@end
__attribute__((objc_root_class))
@interface Extension_Category
@end
@interface Extension_Category ()
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Extension_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Extension_Category
@end
__attribute__((objc_root_class))
@interface Implementation_Category
@end
@interface Implementation_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@implementation Implementation_Category
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
@end
__attribute__((objc_root_class))
@interface Category_Category
@end
@interface Category_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Category_Category (SomeOtherCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Category_Category
@end
__attribute__((objc_root_class))
@interface Category_CategoryImplementation
@end
@interface Category_CategoryImplementation (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct;
@end
@implementation Category_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
@implementation Category_CategoryImplementation
@end
__attribute__((objc_root_class))
@interface Interface_CategoryImplementation
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Interface_CategoryImplementation (SomeCategory)
@end
@implementation Interface_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
@end
@implementation Interface_CategoryImplementation
@end
__attribute__((objc_root_class))
@interface Extension_CategoryImplementation
@end
@interface Extension_CategoryImplementation ()
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Extension_CategoryImplementation (SomeCategory)
@end
@implementation Extension_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
@end
__attribute__((objc_root_class))
@interface OtherCategory_CategoryImplementation
@end
@interface OtherCategory_CategoryImplementation (SomeCategory)
@end
@interface OtherCategory_CategoryImplementation (SomeOtherCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@implementation OtherCategory_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
@end
@implementation OtherCategory_CategoryImplementation
@end
|