summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-05-11 21:37:53 (EDT)
committerSergey Prigogin2013-05-12 13:51:10 (EDT)
commit5189876f064d3c53ef6e7bbca80b7a0fd23a46da (patch)
tree315e496c0985562a3c2accb04157924558df4656
parente5d12140dffe8328c47bfe7c589bf5e84fff812b (diff)
downloadorg.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.zip
org.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.tar.gz
org.eclipse.cdt-5189876f064d3c53ef6e7bbca80b7a0fd23a46da.tar.bz2
Bug 407807 - [Content Assist] No completion for members of object thatrefs/changes/33/12733/2
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>
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java5
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java21
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 ee7f8c4..e7c5e70 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 2b25113..2be7627 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