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}}
51 @interface Radar10309454
53 int IVAR; // expected-note 4 {{previous definition is here}}
57 @interface Radar10309454()
59 int IVAR; // expected-error {{instance variable is already declared}}
60 int PIVAR; // expected-note {{previous definition is here}}
64 @interface Radar10309454()
66 int IVAR; // expected-error {{instance variable is already declared}}
70 @interface Radar10309454()
72 int IVAR; // expected-error {{instance variable is already declared}}
73 int PIVAR; // expected-error {{instance variable is already declared}}
77 @implementation Radar10309454
79 int IVAR; // expected-error {{instance variable is already declared}}
84 @interface Radar14037151 {
90 @implementation Radar14037151
93 myStatus = 1; // works
94 __typeof(myStatus) __in; // works.
96 __typeof(myStatus) __in; // fails.
99 __typeof(myStatus) __in; // fails.
100 struct S1 { // expected-warning {{declaration does not declare anything}}
101 __typeof(myStatus) __in; // fails.
102 struct S { // expected-warning {{declaration does not declare anything}}
103 __typeof(myStatus) __in; // fails.
112 @class NSString, NSData, NSNumber;
134 int d; // expected-note {{previous definition is here}}
135 NSString *e_strong; // expected-note {{previous definition is here}}
136 NSData *f_weak; // expected-note {{previous definition is here}}
137 int g; // expected-note 2 {{previous definition is here}}
142 int g; // expected-note {{previous definition is here}} \
143 // expected-error {{instance variable is already declared}}
147 @implementation Bar {
148 int d; // expected-error {{instance variable is already declared}}
149 NSString *e_strong; // expected-error {{instance variable is already declared}}
150 NSData *f_weak; // expected-error {{instance variable is already declared}}
151 NSData *g; // expected-error 2 {{instance variable is already declared}}