Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-09-16 17:13:59 -0400
committerSergey Prigogin2013-09-16 17:27:24 -0400
commit0e36772a55895b53deb6bad12a9b758e4b556870 (patch)
tree1845c55c9107bc304158ea91d0c113e844dcd5ce
parent8fd76f3f548e23e4a360da464911d17ccd8a1272 (diff)
downloadorg.eclipse.cdt-0e36772a55895b53deb6bad12a9b758e4b556870.tar.gz
org.eclipse.cdt-0e36772a55895b53deb6bad12a9b758e4b556870.tar.xz
org.eclipse.cdt-0e36772a55895b53deb6bad12a9b758e4b556870.zip
Bug 412766 - Allow indexing to continue after encountering an invalid
class member.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java11
2 files changed, 17 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java
index 57f2c35029..b57ac7e433 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java
@@ -1334,4 +1334,13 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
assertTrue(name instanceof IASTImplicitName);
assertEquals("base", name.resolveBinding().getOwner().getName());
}
+
+ // class A {
+ // class B;
+ // };
+ // class D : public A {};
+ // class D::B {};
+ public void _testInvalidOwner_412766() throws Exception {
+ checkBindings();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index 5ce755b25c..b0c9835174 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -540,9 +540,14 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
if (parent instanceof IPDOMCPPClassType) {
if (originalBinding instanceof IEnumerator)
originalBinding = originalBinding.getOwner();
- int visibility = getVisibility(originalBinding);
- if (visibility >= 0) {
- ((IPDOMCPPClassType) parent).addMember(binding, visibility);
+ try {
+ int visibility = getVisibility(originalBinding);
+ if (visibility >= 0) {
+ ((IPDOMCPPClassType) parent).addMember(binding, visibility);
+ return;
+ }
+ } catch (IllegalArgumentException e) {
+ CCorePlugin.log(e);
return;
}
}

Back to the top