Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-09-13 19:46:23 -0400
committerSergey Prigogin2013-09-13 19:46:23 -0400
commita5fafa34280bc3da6122d072fd31a67834433d8f (patch)
tree9411879e78235979b373e6ee26ede9f8027e2a00
parentb5c632f3af98b74ecffc71ae62ff63249f525796 (diff)
downloadorg.eclipse.cdt-a5fafa34280bc3da6122d072fd31a67834433d8f.tar.gz
org.eclipse.cdt-a5fafa34280bc3da6122d072fd31a67834433d8f.tar.xz
org.eclipse.cdt-a5fafa34280bc3da6122d072fd31a67834433d8f.zip
Bug 417240 - Organize Includes inserts unnecessary include for the
header declaring a base class
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java11
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java2
2 files changed, 13 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
index 9699da8e53..07a096ada9 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
@@ -388,6 +388,17 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
assertDeclared("A");
}
+ // class A {};
+ // class B : public A {};
+
+ // void test(B* b) {
+ // const A* a = b;
+ // }
+ public void testBaseClass() throws Exception {
+ assertDefined("B");
+ assertDeclared();
+ }
+
// struct A {};
// template<typename T> struct B {};
// template<typename T, typename U = B<T>> struct C {};
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
index 24beaa3353..ba6a8d5614 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
@@ -520,6 +520,8 @@ public class BindingClassifier {
ICPPClassType[] bases = ClassTypeHelper.getAllBases((ICPPClassType) binding, fAst);
for (ICPPClassType base : bases) {
fProcessedDefinedBindings.add(base);
+ fBindingsToDefine.remove(base);
+ fBindingsToDeclare.remove(base);
}
}

Back to the top