objective-c: fixes a regression in looking up names

in class extensions and categories by recent refactoring
of objc class ASTs. // rdar://1066654

llvm-svn: 147982
This commit is contained in:
Fariborz Jahanian 2012-01-12 00:18:35 +00:00
parent f88480363e
commit 4f8cb1e83a
2 changed files with 25 additions and 2 deletions

View File

@ -1255,8 +1255,11 @@ ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *&Id,
Id = IDecl->getIdentifier();
}
}
return dyn_cast_or_null<ObjCInterfaceDecl>(IDecl);
ObjCInterfaceDecl *Def = dyn_cast_or_null<ObjCInterfaceDecl>(IDecl);
// This routine must always return a class definition, if any.
if (Def && Def->getDefinition())
Def = Def->getDefinition();
return Def;
}
/// getNonFieldDeclScope - Retrieves the innermost scope, starting

View File

@ -16,3 +16,23 @@
@implementation MyObject
@synthesize foo = _foo;
@end
// rdar://10666594
@interface MPMediaItem
@end
@class MPMediaItem;
@interface MPMediaItem ()
@property (nonatomic, readonly) id title;
@end
@interface PodcastEpisodesViewController
@end
@implementation PodcastEpisodesViewController
- (id) Meth {
MPMediaItem *episode;
return episode.title;
}
@end