1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fixes two testcases (testCPPSpecDeclsDefs)

This commit is contained in:
Markus Schorn 2007-02-05 11:46:23 +00:00
parent f33e52a606
commit 0c0eefcf2b

View file

@ -219,24 +219,23 @@ class PDOMCLinkage extends PDOMLinkage {
}
public PDOMBinding resolveBinding(IASTName name) throws CoreException {
int constant;
int[] constants;
IASTNode parent = name.getParent();
if (parent instanceof IASTIdExpression) { // reference
IASTNode eParent = parent.getParent();
if (eParent instanceof IASTFunctionCallExpression) {
constant = CFUNCTION;
constants = new int[] {CFUNCTION};
} else {
constant = CVARIABLE;
constants = new int[] {CVARIABLE, CENUMERATOR};
}
} else if (parent instanceof ICASTElaboratedTypeSpecifier) {
constant = CSTRUCTURE;
constants = new int[] {CSTRUCTURE};
} else if (parent instanceof IASTNamedTypeSpecifier){
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), new int [] {CSTRUCTURE, CENUMERATION, CTYPEDEF});
constants= new int [] {CSTRUCTURE, CENUMERATION, CTYPEDEF};
} else {
return null;
}
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), new int[] {constant});
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), constants);
}
public PDOMNode addType(PDOMNode parent, IType type) throws CoreException {