Debian Codegraph @

clang/test/SemaObjC/conflicting-ivar-test-1.m

raw
1 // RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -fsyntax-only -verify -Wno-objc-root-class %s
2
3 @interface INTF
4 {
5 @public
6 int IVAR; // expected-note {{previous definition is here}}
7 }
8 @end
9
10 @implementation INTF
11 {
12 @private
13
14 int XIVAR; // expected-error {{conflicting instance variable names: 'XIVAR' vs 'IVAR'}}
15 }
16 @end
17
18
19
20 @interface INTF1
21 {
22 @public
23 int IVAR;
24 int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
25 }
26 @end
27
28 @implementation INTF1
29 {
30 @private
31
32 int IVAR;
33 }
34 @end
35
36
37 @interface INTF2
38 {
39 @public
40 int IVAR;
41 }
42 @end
43
44 @implementation INTF2
45 {
46 @private
47
48 int IVAR;
49 int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
50 }
51 @end
52
53
54 @interface INTF3
55 {
56 @public
57 int IVAR; // expected-note {{previous definition is here}}
58 }
59 @end
60
61 @implementation INTF3
62 {
63 @private
64
65 short IVAR; // expected-error {{instance variable 'IVAR' has conflicting type: 'short' vs 'int'}}
66 }
67 @end
68
69 @implementation INTF4 // expected-warning {{cannot find interface declaration for 'INTF4'}}
70 {
71 @private
72
73 short IVAR;
74 }
75 @end
76
77 @interface INTF5
78 {
79 char * ch;
80 }
81 @end
82
83 @implementation INTF5
84 {
85 }
86 @end