diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index ee7f8c4d3a4..e7c5e703a14 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -2274,7 +2274,10 @@ public class CPPSemantics { return true; } IIndexFileSet indexFileSet = ast.getIndexFileSet(); - return indexFileSet != null && indexFileSet.containsDeclaration(indexBinding); + IIndexFileSet astFileSet = ast.getASTFileSet(); + return indexFileSet != null && + (indexFileSet.containsDeclaration(indexBinding) || + astFileSet.containsDeclaration(indexBinding)); } /** diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java index 2b251130613..2be7627edb0 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java @@ -1380,4 +1380,25 @@ public class CompletionTests extends AbstractContentAssistTest { final String[] expected= { "typename" }; assertContentAssistResults(fCursorOffset, 0, expected, true, false, false, COMPARE_REP_STRINGS); } + + // class Base { + // int c; + // }; + // + // struct Cat { + // void meow(); + // }; + // + // struct Derived : Base { + // void foo() { + // c./*cursor*/ + // } + // + // Cat c; + // }; + public void testShadowingBaseClassMember_Bug407807() throws Exception { + final String[] expected = { "Cat", "meow(void)" }; + assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS); + } + } \ No newline at end of file