mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Fixes CCE by removing need for ICPPTemplateDefinition.getTemplateScope(), bug 231744.
This commit is contained in:
parent
b41f6b472d
commit
829a826ec9
26 changed files with 39 additions and 153 deletions
|
@ -25,10 +25,4 @@ public interface ICPPTemplateDefinition extends ICPPBinding {
|
|||
* @return array of ICPPTemplateParameter
|
||||
*/
|
||||
public ICPPTemplateParameter[] getTemplateParameters() throws DOMException;
|
||||
|
||||
/**
|
||||
* Returns the scope defined by this template definition.
|
||||
* @since 5.0
|
||||
*/
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException;
|
||||
}
|
||||
|
|
|
@ -13,10 +13,8 @@
|
|||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||
|
@ -24,10 +22,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition.CPPTemplateProblem;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||
|
||||
/**
|
||||
|
@ -131,16 +126,4 @@ public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
|||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
IScope scope= getCompositeScope().getParent();
|
||||
if (scope instanceof ICPPTemplateScope) {
|
||||
return (ICPPTemplateScope) scope;
|
||||
}
|
||||
IASTNode def= getDefinition();
|
||||
if (def == null) {
|
||||
def= getDeclarations()[0];
|
||||
}
|
||||
throw new DOMException(new CPPTemplateProblem(def, IProblemBinding.SEMANTIC_BAD_SCOPE, CharArrayUtils.EMPTY));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||
|
@ -33,12 +34,13 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
|
|||
|
||||
private IType[] fArguments;
|
||||
private ObjectMap fArgmap;
|
||||
// private ICPPScope fUnknownScope;
|
||||
private ICPPClassTemplate fClassTemplate;
|
||||
|
||||
public CPPDeferredClassInstance(ICPPClassTemplate orig, ObjectMap argMap, IType[] arguments) {
|
||||
super(orig);
|
||||
fArgmap= argMap;
|
||||
fArguments= arguments;
|
||||
fClassTemplate= orig;
|
||||
}
|
||||
|
||||
private ICPPClassTemplate getClassTemplate() {
|
||||
|
@ -81,7 +83,7 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
|
|||
}
|
||||
|
||||
public ICPPTemplateDefinition getTemplateDefinition() {
|
||||
return (ICPPTemplateDefinition) scopeBinding;
|
||||
return fClassTemplate;
|
||||
}
|
||||
|
||||
public ObjectMap getArgumentMap() {
|
||||
|
@ -108,4 +110,9 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
|
|||
public IBinding getSpecializedBinding() {
|
||||
return getTemplateDefinition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IScope getScope() throws DOMException {
|
||||
return fClassTemplate.getScope();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
||||
|
@ -94,9 +93,6 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
|||
public boolean takesVarArgs() throws DOMException {
|
||||
throw new DOMException( this );
|
||||
}
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
throw new DOMException( this );
|
||||
}
|
||||
}
|
||||
|
||||
protected IFunctionType type = null;
|
||||
|
|
|
@ -12,19 +12,13 @@
|
|||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition.CPPTemplateProblem;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||
|
||||
/**
|
||||
|
@ -83,17 +77,4 @@ public class CPPFunctionTemplateSpecialization extends CPPFunctionSpecialization
|
|||
public ICPPSpecialization deferredInstance(ObjectMap argMap, IType[] arguments) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
IScope scope= getFunctionScope().getParent();
|
||||
if (scope instanceof ICPPTemplateScope) {
|
||||
return (ICPPTemplateScope) scope;
|
||||
}
|
||||
IASTNode def= getDefinition();
|
||||
if (def == null) {
|
||||
def= getDeclarations()[0];
|
||||
}
|
||||
throw new DOMException(new CPPTemplateProblem(def, IProblemBinding.SEMANTIC_BAD_SCOPE, CharArrayUtils.EMPTY));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,9 +38,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
|
@ -72,9 +70,6 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
|
|||
public boolean isGloballyQualified() throws DOMException {
|
||||
throw new DOMException(this);
|
||||
}
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
throw new DOMException(this);
|
||||
}
|
||||
}
|
||||
|
||||
//private IASTName templateName;
|
||||
|
@ -239,15 +234,6 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
|
|||
return definition != null ? definition : declarations[0];
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
final IASTName name = getTemplateName();
|
||||
ICPPASTTemplateDeclaration template = CPPTemplates.getTemplateDeclaration(name);
|
||||
if (template != null) {
|
||||
return template.getScope();
|
||||
}
|
||||
throw new DOMException(new CPPTemplateProblem(name, IProblemBinding.SEMANTIC_BAD_SCOPE, CharArrayUtils.EMPTY));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplatedTypeTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
|
@ -33,7 +32,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
|
@ -231,10 +229,6 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
|
|||
return ICPPClassType.EMPTY_CLASS_ARRAY;
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IBinding resolvePartially(ICPPUnknownBinding parentBinding, ObjectMap argMap, ICPPScope instantiationScope) {
|
||||
return null;
|
||||
}
|
||||
|
@ -243,7 +237,7 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
|
|||
return null;
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
|||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
|
@ -76,7 +75,7 @@ public class CPPTemplateTypeParameter extends CPPTemplateParameter implements
|
|||
return null;
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||
|
@ -30,18 +29,17 @@ import org.eclipse.core.runtime.PlatformObject;
|
|||
public abstract class CPPUnknownBinding extends PlatformObject
|
||||
implements ICPPUnknownBinding, ICPPInternalBinding, Cloneable {
|
||||
private ICPPScope unknownScope;
|
||||
protected ICPPBinding scopeBinding;
|
||||
protected ICPPUnknownBinding unknownContainerBinding;
|
||||
protected IASTName name;
|
||||
|
||||
public CPPUnknownBinding(ICPPUnknownBinding scopeBinding, IASTName name) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.scopeBinding = scopeBinding;
|
||||
this.unknownContainerBinding = scopeBinding;
|
||||
}
|
||||
|
||||
public CPPUnknownBinding(ICPPTemplateDefinition templateDef) {
|
||||
this.name= new CPPASTName(templateDef.getNameCharArray());
|
||||
this.scopeBinding= templateDef;
|
||||
}
|
||||
|
||||
public IASTNode[] getDeclarations() {
|
||||
|
@ -82,12 +80,9 @@ public abstract class CPPUnknownBinding extends PlatformObject
|
|||
}
|
||||
|
||||
public IScope getScope() throws DOMException {
|
||||
if (scopeBinding instanceof ICPPUnknownBinding) {
|
||||
return ((ICPPUnknownBinding) scopeBinding).getUnknownScope();
|
||||
} else if (scopeBinding instanceof ICPPTemplateDefinition) {
|
||||
return ((ICPPTemplateDefinition) scopeBinding).getTemplateScope();
|
||||
if (unknownContainerBinding != null) {
|
||||
return unknownContainerBinding.getUnknownScope();
|
||||
}
|
||||
assert false;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -120,7 +115,7 @@ public abstract class CPPUnknownBinding extends PlatformObject
|
|||
return name;
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
return scopeBinding;
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return unknownContainerBinding;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPUnknownCla
|
|||
}
|
||||
|
||||
public IBinding resolvePartially(ICPPUnknownBinding parentBinding, ObjectMap argMap, ICPPScope instantiationScope) {
|
||||
if (parentBinding == this.scopeBinding) {
|
||||
if (parentBinding == this.unknownContainerBinding) {
|
||||
return this;
|
||||
}
|
||||
return new CPPUnknownClass(parentBinding, name);
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
|
||||
|
@ -27,10 +28,11 @@ import org.eclipse.cdt.core.parser.util.ObjectMap;
|
|||
public interface ICPPUnknownBinding extends ICPPBinding {
|
||||
|
||||
/**
|
||||
* Returns the binding of the scope containing this binding.
|
||||
* Returns the binding of the unknown scope containing this binding, or <code>null</code> if the container is not unknown
|
||||
* (applies for {@link ICPPDeferredTemplateInstance}).
|
||||
* @since 5.0
|
||||
*/
|
||||
public ICPPBinding getContainerBinding();
|
||||
public ICPPUnknownBinding getUnknownContainerBinding();
|
||||
|
||||
/**
|
||||
* Returns the scope this binding represents.
|
||||
|
|
|
@ -55,7 +55,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplatedTypeTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||
|
@ -1812,13 +1811,13 @@ public class CPPTemplates {
|
|||
* Attempts to (partially) resolve an unknown binding with the given arguments.
|
||||
*/
|
||||
public static IBinding resolveUnknown(ICPPUnknownBinding unknown, ObjectMap argMap, ICPPScope instantiationScope) throws DOMException {
|
||||
ICPPBinding parentBinding= unknown.getContainerBinding();
|
||||
ICPPUnknownBinding unknownParent= unknown.getUnknownContainerBinding();
|
||||
IBinding result = unknown;
|
||||
IType t = null;
|
||||
if (parentBinding instanceof ICPPTemplateTypeParameter) {
|
||||
t = CPPTemplates.instantiateType((ICPPTemplateTypeParameter) parentBinding, argMap, null);
|
||||
} else if (parentBinding instanceof ICPPUnknownClassType) {
|
||||
IBinding binding= CPPTemplates.resolveUnknown((ICPPUnknownClassType) parentBinding, argMap, instantiationScope);
|
||||
if (unknownParent instanceof ICPPTemplateTypeParameter) {
|
||||
t = CPPTemplates.instantiateType((ICPPTemplateTypeParameter) unknownParent, argMap, null);
|
||||
} else if (unknownParent instanceof ICPPUnknownClassType) {
|
||||
IBinding binding= CPPTemplates.resolveUnknown(unknownParent, argMap, instantiationScope);
|
||||
if (binding instanceof IType) {
|
||||
t = (IType) binding;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
|
@ -90,8 +89,4 @@ public class CompositeCPPClassTemplate extends CompositeCPPClassType
|
|||
|
||||
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getCompositeScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||
|
@ -60,8 +59,4 @@ CompositeCPPClassSpecialization implements ICPPClassTemplate, ICPPInternalTempla
|
|||
public IBinding instantiate(IType[] arguments) {
|
||||
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getCompositeScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
|
@ -56,9 +55,8 @@ public class CompositeCPPDeferredClassInstance extends CompositeCPPClassType imp
|
|||
return ((ICPPUnknownClassType) rbinding).getUnknownName();
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
ICPPBinding scopeBinding= ((ICPPUnknownClassType) rbinding).getContainerBinding();
|
||||
return (ICPPBinding) cf.getCompositeBinding((IIndexFragmentBinding)scopeBinding);
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ICPPScope getUnknownScope() throws DOMException {
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||
|
@ -50,8 +49,4 @@ public class CompositeCPPFunctionTemplate extends CompositeCPPFunction
|
|||
public IBinding instantiate(IType[] arguments) {
|
||||
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getFunctionScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||
|
@ -50,8 +49,4 @@ public class CompositeCPPFunctionTemplateSpecialization extends CompositeCPPFunc
|
|||
public IBinding instantiate(IType[] arguments) {
|
||||
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getFunctionScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
|
|||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
|
@ -143,7 +142,7 @@ class CompositeCPPUnknownClassType extends CompositeCPPBinding implements ICPPUn
|
|||
return ((ICPPUnknownClassType) rbinding).getUnknownName();
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
return ((ICPPUnknownClassType) rbinding).getContainerBinding();
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return ((ICPPUnknownClassType) rbinding).getUnknownContainerBinding();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,10 +208,6 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
|||
|
||||
@Override
|
||||
public IIndexScope getScope() {
|
||||
return getTemplateScope();
|
||||
}
|
||||
|
||||
public PDOMCPPTemplateScope getTemplateScope() {
|
||||
if (scope == null) {
|
||||
scope = new PDOMCPPTemplateScope();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredClassInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
|
@ -171,11 +170,4 @@ class PDOMCPPClassTemplateSpecialization extends
|
|||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + INSTANCES, getLinkageImpl());
|
||||
list.accept(visitor);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition#getTemplateScope()
|
||||
*/
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getCompositeScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
|
|||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
|
@ -171,11 +170,7 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements ICPPDeferr
|
|||
return new CPPASTName(getNameCharArray());
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
try {
|
||||
return (ICPPBinding) getParentBinding();
|
||||
} catch (CoreException e) {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,8 +238,4 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
|||
public IIndexBinding getScopeBinding() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredFunctionInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
|
@ -151,8 +150,4 @@ class PDOMCPPFunctionTemplateSpecialization extends
|
|||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + INSTANCES, getLinkageImpl());
|
||||
list.accept(visitor);
|
||||
}
|
||||
|
||||
public ICPPTemplateScope getTemplateScope() throws DOMException {
|
||||
return (ICPPTemplateScope) getFunctionScope().getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ class PDOMCPPTemplateNonTypeParameter extends PDOMCPPVariable implements IPDOMMe
|
|||
return null;
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class PDOMCPPTemplateTypeParameter extends PDOMCPPBinding implements IPDOMMember
|
|||
public IASTName getUnknownName() {
|
||||
return null;
|
||||
}
|
||||
public ICPPBinding getContainerBinding() {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
|
|||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
|
@ -266,9 +265,9 @@ class PDOMCPPUnknownClassType extends PDOMCPPBinding implements ICPPClassScope,
|
|||
return new CPPASTName(getNameCharArray());
|
||||
}
|
||||
|
||||
public ICPPBinding getContainerBinding() {
|
||||
public ICPPUnknownBinding getUnknownContainerBinding() {
|
||||
try {
|
||||
return (ICPPBinding) getParentBinding();
|
||||
return (ICPPUnknownBinding) getParentBinding();
|
||||
} catch (CoreException e) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue