Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java
index b00f13229f3..60b06027cd3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalTypeId.java
@@ -16,6 +16,7 @@ import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionT
import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;
import org.eclipse.cdt.core.dom.ast.IASTNode;
+import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IValue;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization;
@@ -30,14 +31,18 @@ import org.eclipse.core.runtime.CoreException;
/**
* Performs evaluation of an expression.
*/
-public class EvalTypeId extends CPPEvaluation {
+public class EvalTypeId extends CPPDependentEvaluation {
private final IType fInputType;
private final ICPPEvaluation[] fArguments;
private IType fOutputType;
- public EvalTypeId(IType type, ICPPEvaluation... argument) {
+ public EvalTypeId(IType type, IASTNode pointOfDefinition, ICPPEvaluation... arguments) {
+ this(type, findEnclosingTemplate(pointOfDefinition), arguments);
+ }
+ public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) {
+ super(templateDefinition);
fInputType= type;
- fArguments= argument;
+ fArguments= arguments;
}
public IType getInputType() {
@@ -128,6 +133,7 @@ public class EvalTypeId extends CPPEvaluation {
buffer.marshalEvaluation(arg, includeValue);
}
}
+ marshalTemplateDefinition(buffer);
}
public static ISerializableEvaluation unmarshal(int firstByte, ITypeMarshalBuffer buffer) throws CoreException {
@@ -140,7 +146,8 @@ public class EvalTypeId extends CPPEvaluation {
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
}
}
- return new EvalTypeId(type, args);
+ IBinding templateDefinition= buffer.unmarshalBinding();
+ return new EvalTypeId(type, templateDefinition, args);
}
@Override
@@ -162,7 +169,7 @@ public class EvalTypeId extends CPPEvaluation {
IType type = CPPTemplates.instantiateType(fInputType, tpMap, packOffset, within, point);
if (args == fArguments && type == fInputType)
return this;
- return new EvalTypeId(type, args);
+ return new EvalTypeId(type, getTemplateDefinition(), args);
}
@Override
@@ -183,7 +190,7 @@ public class EvalTypeId extends CPPEvaluation {
}
if (args == fArguments)
return this;
- return new EvalTypeId(fInputType, args);
+ return new EvalTypeId(fInputType, getTemplateDefinition(), args);
}
@Override

Back to the top