[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / synthesized-ivar.m
blobd25175f40c7575f69d4ec48e9a9f8902b1356d6b
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2 @interface I
5 @property int IP;
6 @end
8 @implementation I
9 @synthesize IP;
10 - (int) Meth {
11    return IP;
13 @end
15 // rdar://7823675
16 int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is private}}
18 // rdar://8769582
20 @interface I1 {
21  int protected_ivar;
23 @property int PROP_INMAIN;
24 @end
26 @interface I1() {
27  int private_ivar;
29 @property int PROP_INCLASSEXT;
30 @end
32 @implementation I1
33 - (int) Meth {
34    _PROP_INMAIN = 1;
35    _PROP_INCLASSEXT = 2;
36    protected_ivar = 1;  // OK
37    return private_ivar; // OK
39 @end
42 @interface DER : I1
43 @end
45 @implementation DER
46 - (int) Meth {
47    protected_ivar = 1;  // OK
48    _PROP_INMAIN = 1; // expected-error {{instance variable '_PROP_INMAIN' is private}}
49    _PROP_INCLASSEXT = 2; // expected-error {{instance variable '_PROP_INCLASSEXT' is private}}
50    return private_ivar; // expected-error {{instance variable 'private_ivar' is private}}
52 @end
54 @interface A
55 @property (weak) id testObjectWeakProperty; // expected-note {{declared here}}
56 @end
58 @implementation A
59 // rdar://9605088
60 @synthesize testObjectWeakProperty; // expected-error {{cannot synthesize weak property because the current deployment target does not support weak references}}
61 @end