mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Bug 414450 - Fixed CompositingNotImplementedError for
CPPAliasTemplateInstance.
This commit is contained in:
parent
8722849f10
commit
290cf3472d
1 changed files with 21 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2010 Symbian Software Systems and others.
|
||||
* Copyright (c) 2007, 2013 Symbian Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -24,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
|||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.IValue;
|
||||
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.dom.ast.cpp.ICPPClassScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
|
@ -59,6 +60,7 @@ import org.eclipse.cdt.core.index.IIndex;
|
|||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
import org.eclipse.cdt.core.index.IIndexMacroContainer;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.Value;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPAliasTemplateInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPArrayType;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionType;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameterPackType;
|
||||
|
@ -123,7 +125,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
|
|||
if (rscope instanceof ICPPNamespaceScope) {
|
||||
ICPPNamespace[] namespaces;
|
||||
if (rscope instanceof CompositeCPPNamespace) {
|
||||
// avoid duplicating the search
|
||||
// Avoid duplicating the search.
|
||||
namespaces = ((CompositeCPPNamespace) rscope).namespaces;
|
||||
} else {
|
||||
namespaces = getNamespaces(rscope.getScopeBinding());
|
||||
|
@ -211,19 +213,26 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
|
|||
}
|
||||
return at;
|
||||
}
|
||||
if (rtype instanceof ICPPAliasTemplateInstance) {
|
||||
ICPPAliasTemplateInstance instance = (ICPPAliasTemplateInstance) rtype;
|
||||
ICPPAliasTemplate aliasTemplate = instance.getTemplateDefinition();
|
||||
if (aliasTemplate instanceof IIndexFragmentBinding)
|
||||
aliasTemplate = (ICPPAliasTemplate) getCompositeBinding((IIndexFragmentBinding) aliasTemplate);
|
||||
IType aliasedType = getCompositeType(instance.getType());
|
||||
return new CPPAliasTemplateInstance(instance.getNameCharArray(), aliasTemplate, aliasedType);
|
||||
}
|
||||
if (rtype instanceof TypeOfDependentExpression) {
|
||||
TypeOfDependentExpression tde= (TypeOfDependentExpression) rtype;
|
||||
ICPPEvaluation e= tde.getEvaluation();
|
||||
TypeOfDependentExpression type= (TypeOfDependentExpression) rtype;
|
||||
ICPPEvaluation e= type.getEvaluation();
|
||||
ICPPEvaluation e2= getCompositeEvaluation(e);
|
||||
if (e != e2)
|
||||
return new TypeOfDependentExpression(e2);
|
||||
return tde;
|
||||
return type;
|
||||
}
|
||||
if (rtype instanceof ICPPUnaryTypeTransformation) {
|
||||
ICPPUnaryTypeTransformation ttt= (ICPPUnaryTypeTransformation) rtype;
|
||||
IType operand = ttt.getOperand();
|
||||
IType operand2 = getCompositeType(operand);
|
||||
return new CPPUnaryTypeTransformation(ttt.getOperator(), operand2);
|
||||
ICPPUnaryTypeTransformation typeTransformation= (ICPPUnaryTypeTransformation) rtype;
|
||||
IType operand = getCompositeType(typeTransformation.getOperand());
|
||||
return new CPPUnaryTypeTransformation(typeTransformation.getOperator(), operand);
|
||||
}
|
||||
if (rtype instanceof IBasicType || rtype == null || rtype instanceof ISemanticProblem) {
|
||||
return rtype;
|
||||
|
@ -646,11 +655,13 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
|
|||
final long i;
|
||||
final int j;
|
||||
final long k;
|
||||
|
||||
public Key(long id1, int id2, long id3) {
|
||||
i= id1;
|
||||
j= id2;
|
||||
k= id3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
@ -660,6 +671,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
|
|||
result = prime * result + (int) k;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Key) {
|
||||
|
|
Loading…
Add table
Reference in a new issue