// Reject the cast of super idiom in ObjC.
if (Tok.is(tok::identifier) && getLang().ObjC1 &&
Tok.getIdentifierInfo() == Ident_super &&
- CurScope->isInObjcMethodScope()) {
+ CurScope->isInObjcMethodScope() &&
+ GetLookAheadToken(1).isNot(tok::period)) {
Diag(Tok.getLocation(), diag::err_illegal_super_cast)
<< SourceRange(OpenLoc, RParenLoc);
return ExprError();
[super cMethod]; // expected-warning{{method '+cMethod' not found (return type defaults to 'id')}}
id X[] = { [ super superClassMethod] };
- id Y[] = { [ super.superClassMethod iMethod] };
+ id Y[] = {
+ [ super.superClassMethod iMethod],
+ super.superClassMethod,
+ (id)super.superClassMethod // not a cast of super: rdar://7853261
+ };
return 0;
}
@end