blob: 926538af61c9ca073256a6aee640639148f1ab3d [file] [log] [blame]
Fariborz Jahanian112c3302011-01-04 20:05:20 +00001// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -verify %s
Fariborz Jahanian53395af2010-02-23 18:50:01 +00002
3/**
4When processing @synthesize, treat ivars in a class extension the same as ivars in the class @interface,
5and treat ivars in a superclass extension the same as ivars in the superclass @interface.
6In particular, when searching for an ivar to back an @synthesize, do look at ivars in the class's own class
7extension but ignore any ivars in superclass class extensions.
8*/
9
10@interface Super {
11 int ISA;
12}
13@end
14
15@interface Super() {
16 int Property; // expected-note {{previously declared 'Property' here}}
17}
18@end
19
20@interface SomeClass : Super {
21 int interfaceIvar1;
22 int interfaceIvar2;
23}
24@property int Property;
25@property int Property1;
26@end
27
28@interface SomeClass () {
29 int Property1;
30}
31@end
32
33@implementation SomeClass
34@synthesize Property; // expected-error {{property 'Property' attempting to use ivar 'Property' declared in super class 'Super'}}
35@synthesize Property1; // OK
36@end