bool InBaseClass,
VisibleDeclConsumer &Consumer,
VisibleDeclsRecord &Visited) {
+ if (!Ctx)
+ return;
+
// Make sure we don't visit the same context twice.
if (Visited.visitedContext(Ctx->getPrimaryContext()))
return;
// For instance methods, look for ivars in the method's interface.
LookupResult IvarResult(Result.getSema(), Result.getLookupName(),
Result.getNameLoc(), Sema::LookupMemberName);
- ObjCInterfaceDecl *IFace = Method->getClassInterface();
- LookupVisibleDecls(IFace, IvarResult, /*QualifiedNameLookup=*/false,
- /*InBaseClass=*/false, Consumer, Visited);
+ if (ObjCInterfaceDecl *IFace = Method->getClassInterface())
+ LookupVisibleDecls(IFace, IvarResult, /*QualifiedNameLookup=*/false,
+ /*InBaseClass=*/false, Consumer, Visited);
}
// We've already performed all of the name lookup that we need
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// <rdar://problem/7605289>
+@implementation Unknown (Blarg) // expected-error{{cannot find interface declaration for 'Unknown'}}
+- (int)method { return ivar; } // expected-error{{use of undeclared identifier 'ivar'}}
+@end
- (int)send:(void*)buffer bytes:(int)bytes;
@end
-@interface IPv8 <Network_Socket> // expected-error{{cannot find protocol declaration for 'Network_Socket'; did you mean 'NetworkSocket'?}}
+@interface IPv6 <Network_Socket> // expected-error{{cannot find protocol declaration for 'Network_Socket'; did you mean 'NetworkSocket'?}}
@end