diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index ec633d177c44..68eccfc28025 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -2484,7 +2484,17 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, Visited.add(*P); } } + } else if (ObjCClassDecl *Class = dyn_cast(*D)) { + for (ObjCClassDecl::iterator I = Class->begin(), IEnd = Class->end(); + I != IEnd; ++I) { + ObjCInterfaceDecl *IFace = I->getInterface(); + if (Result.isAcceptableDecl(IFace)) { + Consumer.FoundDecl(IFace, Visited.checkHidden(IFace), InBaseClass); + Visited.add(IFace); + } + } } + // Visit transparent contexts and inline namespaces inside this context. if (DeclContext *InnerCtx = dyn_cast(*D)) { if (InnerCtx->isTransparentContext() || InnerCtx->isInlineNamespace()) diff --git a/clang/test/Index/complete-properties.m b/clang/test/Index/complete-properties.m index 0a19f1113345..725f180f7c29 100644 --- a/clang/test/Index/complete-properties.m +++ b/clang/test/Index/complete-properties.m @@ -1,6 +1,6 @@ /* Note: the RUN lines are near the end of the file, since line/column matter for this test. */ - +@class MyClass; @interface I1 { id StoredProp3; @@ -54,3 +54,6 @@ id test(I3 *i3) { // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35) // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35) +// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50) +