mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Bug 430230. Few follow up fixes.
This commit is contained in:
parent
aa2ae49463
commit
db4c3d2c3e
1 changed files with 12 additions and 3 deletions
|
@ -31,6 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ISerializableEvaluation;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.Value;
|
import org.eclipse.cdt.internal.core.dom.parser.Value;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPPointerType;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPPointerType;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
|
@ -170,7 +171,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
|
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
args = ICPPEvaluation.EMPTY_ARRAY; // arguments must not be null
|
args = ICPPEvaluation.EMPTY_ARRAY; // Arguments must not be null
|
||||||
}
|
}
|
||||||
IBinding templateDefinition= buffer.unmarshalBinding();
|
IBinding templateDefinition= buffer.unmarshalBinding();
|
||||||
boolean forNewExpression = (firstBytes & ITypeMarshalBuffer.FLAG2) != 0;
|
boolean forNewExpression = (firstBytes & ITypeMarshalBuffer.FLAG2) != 0;
|
||||||
|
@ -185,12 +186,12 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
if (args == fArguments && type == fInputType)
|
if (args == fArguments && type == fInputType)
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
if (!CPPTemplates.isDependentType(type) && type instanceof ICPPClassType) {
|
if (!CPPTemplates.isDependentType(type) && !areArgumentTypesDependent() && type instanceof ICPPClassType) {
|
||||||
// Check the constructor call and return EvalFixed.INCOMPLETE to indicate a substitution
|
// Check the constructor call and return EvalFixed.INCOMPLETE to indicate a substitution
|
||||||
// failure if the call cannot be resolved.
|
// failure if the call cannot be resolved.
|
||||||
ICPPClassType classType = (ICPPClassType) type;
|
ICPPClassType classType = (ICPPClassType) type;
|
||||||
LookupData data = new LookupData(classType.getNameCharArray(), null, point);
|
LookupData data = new LookupData(classType.getNameCharArray(), null, point);
|
||||||
ICPPConstructor[] constructors = classType.getConstructors();
|
ICPPConstructor[] constructors = ClassTypeHelper.getConstructors(classType, point);
|
||||||
data.foundItems = constructors;
|
data.foundItems = constructors;
|
||||||
data.setFunctionArguments(false, fArguments);
|
data.setFunctionArguments(false, fArguments);
|
||||||
try {
|
try {
|
||||||
|
@ -243,4 +244,12 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean areArgumentTypesDependent() {
|
||||||
|
for (ICPPEvaluation arg : fArguments) {
|
||||||
|
if (arg.isTypeDependent())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue