Consumer.addKeywordResult(Context, "typeof");
}
- if (WantCXXNamedCasts) {
+ if (WantCXXNamedCasts && getLangOptions().CPlusPlus) {
Consumer.addKeywordResult(Context, "const_cast");
Consumer.addKeywordResult(Context, "dynamic_cast");
Consumer.addKeywordResult(Context, "reinterpret_cast");
BestIvarOrPropertyDecl = 0;
FoundIvarOrPropertyDecl = false;
Consumer.clear_decls();
+ } else if (CTC == CTC_ObjCMessageReceiver &&
+ (*Consumer.keyword_begin())->isStr("super")) {
+ // In an Objective-C message send, give the "super" keyword a slight
+ // edge over entities not in function or method scope.
+ for (TypoCorrectionConsumer::iterator I = Consumer.begin(),
+ IEnd = Consumer.end();
+ I != IEnd; ++I) {
+ if ((*I)->getDeclName() == BestName) {
+ if ((*I)->getDeclContext()->isFunctionOrMethod())
+ return DeclarationName();
+ }
+ }
+
+ // Everything found was outside a function or method; the 'super'
+ // keyword takes precedence.
+ BestIvarOrPropertyDecl = 0;
+ FoundIvarOrPropertyDecl = false;
+ Consumer.clear_decls();
+ BestName = *Consumer.keyword_begin();
} else {
// Name collision; we will not correct typos.
return DeclarationName();
@end
-#ifdef NON_FIXITS
double *isupper(int);
@interface Sub2 : Super
@implementation Sub2
- (int)method2 {
- return [supper method2]; // expected-error{{use of undeclared identifier 'supper'}}
+ return [supper method2]; // expected-error{{unknown receiver 'supper'; did you mean 'super'?}}
}
@end
-#endif
@interface Ivar
@end
@end
@implementation User
-@synthesize ivar;
+@synthesize ivar; // expected-error{{synthesized property 'ivar' must either be named the same as a compatible ivar or must explicitly name an ivar}}
- (void)method {
// Test that we don't correct 'ivar' to 'Ivar' e