Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-11-20 14:47:17 -0500
committerSergey Prigogin2013-11-20 15:02:21 -0500
commitf923ac33421be532f5fa828f459b7ee1afc083c4 (patch)
treed11149addbdec5f2e4c615769b16abadd8bc234a
parent79b33999775ab676da4af56d1966fb8fae9a0985 (diff)
downloadorg.eclipse.cdt-f923ac33421be532f5fa828f459b7ee1afc083c4.tar.gz
org.eclipse.cdt-f923ac33421be532f5fa828f459b7ee1afc083c4.tar.xz
org.eclipse.cdt-f923ac33421be532f5fa828f459b7ee1afc083c4.zip
Bug 421398 - Organize Includes not adds includes for 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, 12 insertions, 1 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 4c63997f3d..c81e0433be 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
@@ -411,6 +411,17 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
assertDeclared();
}
+ // class Base {};
+
+ // class Derived : public Base {
+ // public:
+ // Derived();
+ // };
+ public void testBaseClause_421398() throws Exception {
+ assertDefined("Base");
+ 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 22a4a99107..2923874c43 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
@@ -515,7 +515,7 @@ public class BindingClassifier {
// Record the fact that we also have a definition of the typedef's target type.
markAsDefined((IBinding) type);
}
- } else if (binding instanceof ICPPClassType) {
+ } else if (binding instanceof ICPPClassType && fAst.getDefinitionsInAST(binding).length == 0) {
// The header that defines a class must provide definitions of all its base classes.
ICPPClassType[] bases = ClassTypeHelper.getAllBases((ICPPClassType) binding, fAst);
for (ICPPClassType base : bases) {

Back to the top