Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNathan Ridge2019-06-20 20:12:19 -0400
committerNathan Ridge2019-06-24 19:09:32 -0400
commitf65e93596eae67ec554c395903ecca1a1e4b2f02 (patch)
tree51e153a5d124d63b7a6dcb3ea256f805e8aa8c2a /core
parent6b435e1faf0a9d14ad1f550b44dccef324307443 (diff)
downloadorg.eclipse.cdt-f65e93596eae67ec554c395903ecca1a1e4b2f02.tar.gz
org.eclipse.cdt-f65e93596eae67ec554c395903ecca1a1e4b2f02.tar.xz
org.eclipse.cdt-f65e93596eae67ec554c395903ecca1a1e4b2f02.zip
Bug 548482 - Add CPPClassSpecialization.RecursionResolvingConstructor
This avoids an ArrayStoreException in specializeMembers(). Change-Id: I88a92462ef1ace4e99a0b45a9ba5975c705dab67
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
index 39b5ea6808..174e0e260f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
@@ -53,6 +53,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
import org.eclipse.cdt.internal.core.dom.parser.ProblemFunctionType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExecIncomplete;
import org.eclipse.core.runtime.Assert;
/**
@@ -65,7 +66,9 @@ public class CPPClassSpecialization extends CPPSpecialization
implements ICPPMember, IRecursionResolvingBinding {
public static RecursionResolvingBinding createFor(IBinding original) {
IASTNode point = CPPSemantics.getCurrentLookupPoint();
- if (original instanceof ICPPMethod)
+ if (original instanceof ICPPConstructor)
+ return new RecursionResolvingConstructor(point, original.getNameCharArray());
+ else if (original instanceof ICPPMethod)
return new RecursionResolvingMethod(point, original.getNameCharArray());
if (original instanceof ICPPField)
return new RecursionResolvingField(point, original.getNameCharArray());
@@ -104,7 +107,7 @@ public class CPPClassSpecialization extends CPPSpecialization
}
}
- public final static class RecursionResolvingMethod extends RecursionResolvingBinding implements ICPPMethod {
+ public static class RecursionResolvingMethod extends RecursionResolvingBinding implements ICPPMethod {
public RecursionResolvingMethod(IASTNode node, char[] arg) {
super(node, arg);
}
@@ -160,6 +163,24 @@ public class CPPClassSpecialization extends CPPSpecialization
}
}
+ public final static class RecursionResolvingConstructor extends RecursionResolvingMethod
+ implements ICPPConstructor {
+ public RecursionResolvingConstructor(IASTNode node, char[] arg) {
+ super(node, arg);
+ }
+
+ @Override
+ public ICPPExecution getConstructorChainExecution(IASTNode point) {
+ return getConstructorChainExecution();
+ }
+
+ @Override
+ public ICPPExecution getConstructorChainExecution() {
+ return ExecIncomplete.INSTANCE;
+ }
+
+ }
+
private ICPPClassSpecializationScope specScope;
private ObjectMap specializationMap = ObjectMap.EMPTY_MAP;
private ICPPBase[] bases;

Back to the top