[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / typo-correction.m
blob47e0ab0960af1350bae39cfd6a1bfedd574f9567
1 // RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-runtime=ios
3 @protocol P
4 -(id)description;
5 @end
7 @interface B<P>
8 @property int x;
9 @end
11 @interface S : B {
12   id _someivar; // expected-note {{here}}
14 @end
16 // Spell-checking 'undefined' is ok.
17 undefined var; // expected-error {{unknown type name}}
19 typedef int super1;
20 @implementation S
21 -(void)foo:(id)p1 other:(id)p2 {
22   // Spell-checking 'super' is not ok.
23   super.x = 0;
24   self.x = 0;
27 -(void)test {
28   [self foo:[super description] other:someivar]; // expected-error {{use of undeclared identifier 'someivar'; did you mean '_someivar'?}}
30 @end
32 __attribute__ (( __objc_root_class__ ))
33 @interface I {
34   id _interface; // expected-note {{'_interface' declared here}}
36 -(void)method;
37 @end
39 @interface I () {
40   id _extension; // expected-note {{'_extension' declared here}}
42 @end
44 @implementation I {
45   id _implementation; // expected-note {{'_implementation' declared here}}
47 -(void)method {
48   (void)self->implementation; // expected-error {{'I' does not have a member named 'implementation'; did you mean '_implementation'?}}
49   (void)self->interface; // expected-error {{'I' does not have a member named 'interface'; did you mean '_interface'?}}
50   (void)self->extension; // expected-error {{'I' does not have a member named 'extension'; did you mean '_extension'?}}
52 @end
54 // rdar://problem/33102722
55 // Typo correction for a property when it has as correction candidates
56 // synthesized ivar and a class name, both at the same edit distance.
57 @class TypoCandidate;
59 __attribute__ (( __objc_root_class__ ))
60 @interface PropertyType
61 @property int x;
62 @end
64 __attribute__ (( __objc_root_class__ ))
65 @interface InterfaceC
66 @property(assign) PropertyType *typoCandidate; // expected-note {{'_typoCandidate' declared here}}
67 @end
69 @implementation InterfaceC
70 -(void)method {
71   typoCandidate.x = 0; // expected-error {{use of undeclared identifier 'typoCandidate'; did you mean '_typoCandidate'?}}
73 @end