diff options
author | Nathan Ridge | 2013-05-12 01:37:53 +0000 |
---|---|---|
committer | Sergey Prigogin | 2013-05-12 17:51:10 +0000 |
commit | 5189876f064d3c53ef6e7bbca80b7a0fd23a46da (patch) | |
tree | 315e496c0985562a3c2accb04157924558df4656 | |
parent | e5d12140dffe8328c47bfe7c589bf5e84fff812b (diff) | |
download | org.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.tar.gz org.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.tar.xz org.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.zip |
Bug 407807 - [Content Assist] No completion for members of object that
shadows object in base class
Change-Id: I30bf6064de788f766f871cdea1776d849c8284c5
Reviewed-on: https://git.eclipse.org/r/12733
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2 files changed, 25 insertions, 1 deletions
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 |