mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 509769 - ASTInternal.getDefinitionOfBinding() called for binding of
type ... errors in the log Have CPPAliasTemplate and CPPAliasTemplateInstance implement ICPPInternalBinding. Change-Id: Ibffe6d1baa29dcfe6566de42ec51a3274b893957
This commit is contained in:
parent
216bc162a4
commit
a5fb52baa3
2 changed files with 60 additions and 14 deletions
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.core.dom.ILinkage;
|
|||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||
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.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
|
@ -30,7 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|||
import org.eclipse.core.runtime.PlatformObject;
|
||||
|
||||
public class CPPAliasTemplate extends PlatformObject
|
||||
implements ICPPAliasTemplate, ICPPTemplateParameterOwner {
|
||||
implements ICPPAliasTemplate, ICPPTemplateParameterOwner, ICPPInternalBinding {
|
||||
private final IASTName aliasName;
|
||||
private final IType aliasedType;
|
||||
private ICPPTemplateParameter[] templateParameters;
|
||||
|
@ -126,11 +127,6 @@ public class CPPAliasTemplate extends PlatformObject
|
|||
return templateParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ASTTypeUtil.getQualifiedName(this) + " -> " + ASTTypeUtil.getType(aliasedType, true); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinding resolveTemplateParameter(ICPPTemplateParameter templateParameter) {
|
||||
int pos= templateParameter.getParameterPosition();
|
||||
|
@ -142,4 +138,30 @@ public class CPPAliasTemplate extends PlatformObject
|
|||
}
|
||||
return templateParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTNode getDefinition() {
|
||||
return aliasName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTNode[] getDeclarations() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDefinition(IASTNode node) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDeclaration(IASTNode node) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/** For debugging only. */
|
||||
@Override
|
||||
public String toString() {
|
||||
return ASTTypeUtil.getQualifiedName(this) + " -> " + ASTTypeUtil.getType(aliasedType, true); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,12 +15,12 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
|||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||
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.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPAliasTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPAliasTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||
|
@ -28,7 +28,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|||
import org.eclipse.core.runtime.PlatformObject;
|
||||
|
||||
public class CPPAliasTemplateInstance extends PlatformObject
|
||||
implements ICPPAliasTemplateInstance, ITypeContainer {
|
||||
implements ICPPAliasTemplateInstance, ITypeContainer, ICPPInternalBinding {
|
||||
private final char[] name;
|
||||
private final ICPPAliasTemplate aliasTemplate;
|
||||
private IType aliasedType;
|
||||
|
@ -107,11 +107,6 @@ public class CPPAliasTemplateInstance extends PlatformObject
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ASTTypeUtil.getQualifiedName(this) + " -> " + ASTTypeUtil.getType(aliasedType, true); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getQualifiedName() {
|
||||
return CPPVisitor.getQualifiedName(this);
|
||||
|
@ -124,6 +119,35 @@ public class CPPAliasTemplateInstance extends PlatformObject
|
|||
|
||||
@Override
|
||||
public boolean isGloballyQualified() throws DOMException {
|
||||
return ((ICPPBinding) aliasTemplate).isGloballyQualified();
|
||||
return aliasTemplate.isGloballyQualified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTNode getDefinition() {
|
||||
if (aliasTemplate instanceof ICPPInternalBinding) {
|
||||
return ((ICPPInternalBinding) aliasTemplate).getDefinition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTNode[] getDeclarations() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDefinition(IASTNode node) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDeclaration(IASTNode node) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/** For debugging only. */
|
||||
@Override
|
||||
public String toString() {
|
||||
return ASTTypeUtil.getQualifiedName(this) + " -> " + ASTTypeUtil.getType(aliasedType, true); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue