virtual bool ValidateCandidate(const TypoCorrection &candidate) {
if (FieldDecl *FD = candidate.getCorrectionDeclAs<FieldDecl>())
return isa<ObjCIvarDecl>(FD);
+ if (NextToken.is(tok::equal))
+ return candidate.getCorrectionDeclAs<VarDecl>();
return CorrectionCandidateCallback::ValidateCandidate(candidate);
}
}
}
}
+
+long readline(const char *, char *, unsigned long);
+void assign_to_unknown_var() {
+ deadline_ = 1; // expected-error-re {{use of undeclared identifier 'deadline_'$}}
+}
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
-@interface Sprite { // expected-note{{'Sprite' declared here}}
+@interface Sprite {
int sprite, spree;
int UseGlobalBar;
}
+ (void)setFoo:(int)foo {
sprite = foo; // expected-error {{instance variable 'sprite' accessed in class method}}
spree = foo;
- Xsprite = foo; // expected-error {{unknown type name 'Xsprite'; did you mean 'Sprite'?}} \
- // expected-error{{expected identifier or '('}}
+ Xsprite = foo; // expected-error {{use of undeclared identifier 'Xsprite'}}
UseGlobalBar = 10;
}
+ (void)setSprite:(int)sprite {