1 // RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-objc-root-class
7 ClassB(ClassA* parent=0);
14 @interface InterfaceA : NSObject
15 @property(nonatomic, assign) ClassA *m_prop1; // expected-note {{here}}
16 @property(nonatomic, assign) ClassB *m_prop2;
19 @implementation InterfaceA
21 self.m_prop2 = new ClassB(m_prop1); // expected-error {{use of undeclared identifier 'm_prop1'; did you mean '_m_prop1'?}}
25 @interface InvalidNameInIvarAndPropertyBase
33 void invalidNameInIvarAndPropertyBase() {
34 float a = ((InvalidNameInIvarAndPropertyBase*)node)->_a; // expected-error {{use of undeclared identifier 'node'}}
35 float b = ((InvalidNameInIvarAndPropertyBase*)node)._b; // expected-error {{use of undeclared identifier 'node'}}
38 // Typo correction for a property when it has as correction candidates
39 // synthesized ivar and a class name, both at the same edit distance.
42 @interface PropertyType : NSObject
46 @interface InterfaceC : NSObject
47 @property(assign) PropertyType *typoCandidate; // expected-note {{'_typoCandidate' declared here}}
50 @implementation InterfaceC
52 typoCandidate.x = 0; // expected-error {{use of undeclared identifier 'typoCandidate'; did you mean '_typoCandidate'?}}
56 // The scope of 'do-while' ends before typo-correction takes place.
58 struct Mat2 { int rows; };
60 @implementation ImplNoInt // expected-warning {{cannot find interface declaration for 'ImplNoInt'}}
62 - (void)typoCorrentInDoWhile {
63 Mat2 tlMat1; // expected-note {{'tlMat1' declared here}}
64 // Create many scopes to exhaust the cache.
66 for (int index = 0; index < 2; index++) {
68 for (int specialTileType = 1; specialTileType < 5; specialTileType++) {
69 for (int i = 0; i < 10; i++) {
70 for (double scale = 0.95; scale <= 1.055; scale += 0.05) {
71 for (int j = 0; j < 10; j++) {
73 for (int sptile = 1; sptile < 5; sptile++) {
82 } while (tlMat.rows); // expected-error {{use of undeclared identifier 'tlMat'; did you mean 'tlMat1'}}