forked from OSchip/llvm-project
Fix <rdar://problem/6450964> clang on xcode: Assertion failed: (RecordForDecl && "lookupFieldDeclForIvar no storage for class").
This was a recent regression caused by r61043 (related to code gen. for ivar references). Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later. llvm-svn: 61134
This commit is contained in:
parent
015a7f57b2
commit
596e137c84
|
@ -369,6 +369,8 @@ void ObjCInterfaceDecl::addInstanceVariablesToClass(ObjCIvarDecl **ivars,
|
|||
///
|
||||
FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
|
||||
const ObjCIvarDecl *ivar) {
|
||||
if (!RecordForDecl)
|
||||
addRecordToClass(Context);
|
||||
assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");
|
||||
DeclarationName Member = ivar->getDeclName();
|
||||
DeclContext::lookup_result Lookup = RecordForDecl->lookup(Context, Member);
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
// RUN: clang %s -fsyntax-only -verify
|
||||
@interface A
|
||||
{
|
||||
int ivar;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface B : A
|
||||
- (int)ivar;
|
||||
@end
|
||||
|
||||
@implementation B
|
||||
- (int)ivar {
|
||||
return ivar;
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue