forked from OSchip/llvm-project
objc: Don't crash on missing @interface decl.
// rdar://10415026 llvm-svn: 144143
This commit is contained in:
parent
26573c5585
commit
557fc9a99d
|
@ -1968,12 +1968,13 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
|
|||
}
|
||||
} else if (CurMethod->isInstanceMethod()) {
|
||||
// We should warn if a local variable hides an ivar.
|
||||
ObjCInterfaceDecl *IFace = CurMethod->getClassInterface();
|
||||
ObjCInterfaceDecl *ClassDeclared;
|
||||
if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(II, ClassDeclared)) {
|
||||
if (IV->getAccessControl() != ObjCIvarDecl::Private ||
|
||||
IFace == ClassDeclared)
|
||||
Diag(Loc, diag::warn_ivar_use_hidden) << IV->getDeclName();
|
||||
if (ObjCInterfaceDecl *IFace = CurMethod->getClassInterface()) {
|
||||
ObjCInterfaceDecl *ClassDeclared;
|
||||
if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(II, ClassDeclared)) {
|
||||
if (IV->getAccessControl() != ObjCIvarDecl::Private ||
|
||||
IFace == ClassDeclared)
|
||||
Diag(Loc, diag::warn_ivar_use_hidden) << IV->getDeclName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,3 +19,10 @@ void foo() {
|
|||
@throw (id)0 // expected-error{{expected ';' after @throw}}
|
||||
}
|
||||
|
||||
// <rdar://problem/10415026>
|
||||
@class NSView;
|
||||
@implementation IBFillView(IBFillViewIntegration) // expected-error {{cannot find interface declaration for 'IBFillView'}}
|
||||
- (NSView *)ibDesignableContentView {
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue