brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 5635f5f Raw
73 lines · plain
1// RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-runtime=ios2 3@protocol P4-(id)description;5@end6 7@interface B<P>8@property int x;9@end10 11@interface S : B {12  id _someivar; // expected-note {{here}}13}14@end15 16// Spell-checking 'undefined' is ok.17undefined var; // expected-error {{unknown type name}}18 19typedef int super1;20@implementation S21-(void)foo:(id)p1 other:(id)p2 {22  // Spell-checking 'super' is not ok.23  super.x = 0;24  self.x = 0;25}26 27-(void)test {28  [self foo:[super description] other:someivar]; // expected-error {{use of undeclared identifier 'someivar'; did you mean '_someivar'?}}29}30@end31 32__attribute__ (( __objc_root_class__ ))33@interface I {34  id _interface; // expected-note {{'_interface' declared here}}35}36-(void)method;37@end38 39@interface I () {40  id _extension; // expected-note {{'_extension' declared here}}41}42@end43 44@implementation I {45  id _implementation; // expected-note {{'_implementation' declared here}}46}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'?}}51}52@end53 54// Typo correction for a property when it has as correction candidates55// synthesized ivar and a class name, both at the same edit distance.56@class TypoCandidate;57 58__attribute__ (( __objc_root_class__ ))59@interface PropertyType60@property int x;61@end62 63__attribute__ (( __objc_root_class__ ))64@interface InterfaceC65@property(assign) PropertyType *typoCandidate; // expected-note {{'_typoCandidate' declared here}}66@end67 68@implementation InterfaceC69-(void)method {70  typoCandidate.x = 0; // expected-error {{use of undeclared identifier 'typoCandidate'; did you mean '_typoCandidate'?}}71}72@end73