1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 06:55:23 +02:00

Removed redundant qualifiers.

Change-Id: I28dad37e31f471d2e194b0f83098fd8ca1414894
This commit is contained in:
Sergey Prigogin 2016-07-08 15:38:19 -07:00 committed by Gerrit Code Review @ Eclipse.org
parent 0c87249a55
commit 67f2b199d9
2 changed files with 14 additions and 13 deletions

View file

@ -465,7 +465,7 @@ public class CPPSemantics {
// Do not interpret template arguments to a template class as being
// explicit template arguments to its templated constructor.
data.setTemplateArguments(null);
binding= CPPSemantics.resolveFunction(data, ClassTypeHelper.getConstructors(cls, lookupPoint), true);
binding= resolveFunction(data, ClassTypeHelper.getConstructors(cls, lookupPoint), true);
}
} catch (DOMException e) {
return e.getProblem();
@ -2538,7 +2538,7 @@ public class CPPSemantics {
return CPPDeferredFunction.createForCandidates(fns);
}
IFunction[] ambiguousFunctions= null; // Ambiguity, 2 functions are equally good.
IFunction[] ambiguousFunctions= null; // Ambiguity, two or more functions are equally good.
FunctionCost bestFnCost = null; // The cost of the best function.
// Loop over all functions
@ -3005,7 +3005,7 @@ public class CPPSemantics {
LookupData data= new LookupData(name);
data.setFunctionArguments(false, init.getArguments());
try {
IBinding ctor = CPPSemantics.resolveFunction(data,
IBinding ctor = resolveFunction(data,
ClassTypeHelper.getConstructors((ICPPClassType) targetType, name), true);
if (ctor instanceof ICPPConstructor) {
int i= 0;
@ -3964,13 +3964,13 @@ public class CPPSemantics {
// Find all bindings that match the first part of the name. For each such binding,
// lookup the second part of the name.
for (IBinding binding : CPPSemantics.findBindings(scope, part1, false)) {
for (IBinding binding : findBindings(scope, part1, false)) {
findBindingsForQualifiedName(getLookupScope(binding), part2, bindings);
}
}
private static ICPPScope getNamespaceScope(CPPASTTranslationUnit tu, String[] namespaceParts, IASTNode point)
throws DOMException {
private static ICPPScope getNamespaceScope(CPPASTTranslationUnit tu, String[] namespaceParts,
IASTNode point) throws DOMException {
ICPPScope nsScope= tu.getScope();
outer: for (String nsPart : namespaceParts) {
nsPart= nsPart.trim();
@ -4099,7 +4099,8 @@ public class CPPSemantics {
} else {
if (function instanceof ICPPTemplateDefinition) {
final ICPPTemplateDefinition funcTemplate = (ICPPTemplateDefinition) function;
if (!isSameTemplateParameterList(funcTemplate.getTemplateParameters(), templateDecl.getTemplateParameters())) {
if (!isSameTemplateParameterList(funcTemplate.getTemplateParameters(),
templateDecl.getTemplateParameters())) {
return false;
}
} else {
@ -4118,7 +4119,8 @@ public class CPPSemantics {
return false;
}
private static boolean isSameTemplateParameterList(ICPPTemplateParameter[] tplist, ICPPASTTemplateParameter[] tps) {
private static boolean isSameTemplateParameterList(ICPPTemplateParameter[] tplist,
ICPPASTTemplateParameter[] tps) {
if (tplist.length != tps.length)
return false;

View file

@ -966,7 +966,7 @@ public class CPPTemplates {
} // else reuse last parameter (which should be a pack)
@SuppressWarnings("null")
IValue defaultValue = par.getDefaultValue();
IValue specializedValue = CPPTemplates.instantiateValue(defaultValue, context, maxdepth);
IValue specializedValue = instantiateValue(defaultValue, context, maxdepth);
result[i] = new CPPParameterSpecialization(par, functionSpec, specializedParameterTypes[i],
specializedValue, context.getParameterMap());
}
@ -998,7 +998,7 @@ public class CPPTemplates {
} else if (decl instanceof ICPPClassTemplate) {
ICPPClassTemplate template = (ICPPClassTemplate) decl;
CPPClassTemplateSpecialization classTemplateSpec = new CPPClassTemplateSpecialization(template, owner, tpMap);
classTemplateSpec.setTemplateParameters(CPPTemplates.specializeTemplateParameters(classTemplateSpec,
classTemplateSpec.setTemplateParameters(specializeTemplateParameters(classTemplateSpec,
(ICPPScope) classTemplateSpec.getScope(), template.getTemplateParameters(), owner, point));
spec = classTemplateSpec;
} else if (decl instanceof ICPPClassType) {
@ -1016,7 +1016,7 @@ public class CPPTemplates {
if (decl instanceof ICPPFieldTemplate) {
CPPFieldTemplateSpecialization fieldTempSpec = new CPPFieldTemplateSpecialization(decl,
owner, tpMap, type, value);
ICPPTemplateParameter[] params = CPPTemplates.specializeTemplateParameters(fieldTempSpec,
ICPPTemplateParameter[] params = specializeTemplateParameters(fieldTempSpec,
(ICPPScope) fieldTempSpec.getScope(),
((ICPPFieldTemplate) decl).getTemplateParameters(), owner, point);
fieldTempSpec.setTemplateParameters(params);
@ -1041,7 +1041,7 @@ public class CPPTemplates {
methodSpec = new CPPMethodTemplateSpecialization((ICPPMethod) decl, owner, tpMap,
type, exceptionSpecs);
}
methodSpec.setTemplateParameters(CPPTemplates.specializeTemplateParameters(methodSpec,
methodSpec.setTemplateParameters(specializeTemplateParameters(methodSpec,
(ICPPScope) methodSpec.getScope(),
((ICPPFunctionTemplate) decl).getTemplateParameters(), owner, point));
functionSpec = methodSpec;
@ -1443,7 +1443,6 @@ public class CPPTemplates {
TypeInstantiationRequest instantiationRequest = new TypeInstantiationRequest(type, context);
if (!instantiationsInProgress.get().add(instantiationRequest)) {
System.out.println("Recursion in instantiation of type \"" + type + "\""); //$NON-NLS-1$//$NON-NLS-2$ //XXX
return type instanceof ICPPFunctionType ?
ProblemFunctionType.RECURSION_IN_LOOKUP : ProblemType.RECURSION_IN_LOOKUP;
}