1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
14 -(void) setX: (int) n {
32 int *ip = [Ivar method]; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
33 // Note that there is no warning in Objective-C++
44 @implementation TwoIvars
46 return a + b; // expected-error{{instance variable 'a' accessed in class method}} \
47 // expected-error{{instance variable 'b' accessed in class method}}
52 @interface Radar10309454
54 int IVAR; // expected-note 4 {{previous definition is here}}
58 @interface Radar10309454()
60 int IVAR; // expected-error {{instance variable is already declared}}
61 int PIVAR; // expected-note {{previous definition is here}}
65 @interface Radar10309454()
67 int IVAR; // expected-error {{instance variable is already declared}}
71 @interface Radar10309454()
73 int IVAR; // expected-error {{instance variable is already declared}}
74 int PIVAR; // expected-error {{instance variable is already declared}}
78 @implementation Radar10309454
80 int IVAR; // expected-error {{instance variable is already declared}}
86 @interface Radar14037151 {
92 @implementation Radar14037151
95 myStatus = 1; // works
96 __typeof(myStatus) __in; // works.
98 __typeof(myStatus) __in; // fails.
101 __typeof(myStatus) __in; // fails.
102 struct S1 { // expected-warning {{declaration does not declare anything}}
103 __typeof(myStatus) __in; // fails.
104 struct S { // expected-warning {{declaration does not declare anything}}
105 __typeof(myStatus) __in; // fails.
115 @class NSString, NSData, NSNumber;
137 int d; // expected-note {{previous definition is here}}
138 NSString *e_strong; // expected-note {{previous definition is here}}
139 NSData *f_weak; // expected-note {{previous definition is here}}
140 int g; // expected-note 2 {{previous definition is here}}
145 int g; // expected-note {{previous definition is here}} \
146 // expected-error {{instance variable is already declared}}
150 @implementation Bar {
151 int d; // expected-error {{instance variable is already declared}}
152 NSString *e_strong; // expected-error {{instance variable is already declared}}
153 NSData *f_weak; // expected-error {{instance variable is already declared}}
154 NSData *g; // expected-error 2 {{instance variable is already declared}}